• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question MariaDB my.cnf SQLSTATE[HY000] [2002]

Bogdan1

Regular Pleskian
Could someone check my my.cnf please? What's wrong with it?

[mysqld]
bind-address = ::ffff:127.0.0.1
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
innodb-flush-method = O_DIRECT
innodb-log-files-in-group = 2
innodb-log-file-size = 512M
innodb-flush-log-at-trx-commit = 1
innodb-file-per-table = 1
innodb-buffer-pool-size = 15G


[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

Here is my default(original my.cnf that works)

[mysqld]
bind-address = ::ffff:127.0.0.1
local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0

[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

I'm trying to optimize DB for my VPS

  • KVM OpenStack
  • SLA 99.99 %
  • 4 vCores
  • 2,4 GHz
  • 24 GB RAM
  • 100 GB
    High Availability (Ceph)
Thanks


//IP:8443 returns
ERROR: Zend_Db_Adapter_Exception: SQLSTATE[HY000] [2002] No such file or directory

Additionally, an exception has occurred while trying to report this error: Zend_Exception
No entry is registered for key 'translate' (Abstract.php:144)
 
Last edited:
Looks OK to me. Please check if DB is accessible locally by running the plesk db command. It should open MySQL prompt. Please also check that MariaDB daemon service is running.

Which device is mounted to /var/lib and /var/run in your case? Is there anything unusual there?
 
Looks OK to me. Please check if DB is accessible locally by running the plesk db command. It should open MySQL prompt. Please also check that MariaDB daemon service is running.



Which device is mounted to /var/lib and /var/run in your case? Is there anything unusual there?


ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

exit status 1

PS: Nothing is installed on vps except clean plesk onyx.

Changed back to default my.cnf

[mysqld]
bind-address = ::ffff:127.0.0.1
local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0

[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

and plesk db returning this

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A


Welcome to the MariaDB monitor. Commands end with ; or \g.

Your MariaDB connection id is 5

Server version: 5.5.50-MariaDB MariaDB Server


Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


// You can see, that path to the socket is the same.
 
Last edited:

No, I have 22GB available.

[root@*** ~]# free -h

total used free shared buff/cache available

Mem: 22G 269M 22G 23M 278M 22G

Swap: 0B 0B 0B

log:

InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes

InnoDB: than specified in the .cnf file 0 536870912 bytes!

InnoDB: Possible causes for this error:

(a) Incorrect log file is used or log file size is changed

(b) In case default size is used this log file is from 10.0

(c) Log file is corrupted or there was not enough disk space

In case (b) you need to set innodb_log_file_size = 48M

161130 13:06:45 [ERROR] Plugin 'InnoDB' init function returned error.

161130 13:06:45 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

161130 13:06:45 [Note] Plugin 'FEEDBACK' is disabled.

161130 13:06:45 [ERROR] Unknown/unsupported storage engine: InnoDB

161130 13:06:45 [ERROR] Aborting


161130 13:06:45 [Note] /usr/libexec/mysqld: Shutdown complete


161130 13:06:45 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
 
The log gives the answer:

InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes
InnoDB: than specified in the .cnf file 0 536870912 bytes!

you go from 1 to 2 log files. Stopping mariadb, deleting the logfile and starting again will normaly solve logfile problems.

regards
Jan
 
Back
Top