Im using Centos7 & Mariadb 10.5.17 & php 8.0.23. I would like to change my innodb_buffer_pool_size from 128MB to 12GB. My server has 44GB ram.
When i change my mf.cnf file i got this error message
SQLSTATE[HY000] [2002] Connection refused
This is how i connect to database
db.php
set_exception_handler(function ($e) {
insertExceptionLog($e->getMessage(), $e->getTrace());
});
$dsn = "mysql:host=127.0.0.1;dbname=my_db_name;charset=utf8mb4";
$options = [
PDO::ATTR_EMULATE_PREPARES => false, // turn off emulation mode for "real" prepared statements
PDO::ATTR_STRINGIFY_FETCHES => false,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, //turn on errors in the form of exceptions
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, //make the default fetch be an associative array
PDO::ATTR_PERSISTENT => true,
];
$pdo = new PDO($dsn, "username", "xxx", $options);
This is my working my.cnf file
[mysqld]
bind-address = ::
local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
This my not working my.cnf file
[mysqld]
bind-address = ::
local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
# added line
innodb_buffer_pool_size = 12G
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d