suddenly cannot connect database
04-06-2017, 11:06 AM
(This post was last modified: 04-06-2017, 11:40 AM by david4321.)
when i try go surf sentora login page , it say cannot connect database.
maybe I did not shutdown linux normally yesterday
I try to reboot my vps but still not working.
when i type mysql in ssh, it said
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
How can I fix it?
Thanks
Critical Error: [0100] - Unable to connect or authenticate to the Sentora database (sentora_core).
We advice that you contact the server administrator to ensure that the database server is online and that the correct connection parameters are being used.
http://forums.sentora.org/showthread.php...mysql.sock
I try found this post but still can't fix it.
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 48G 40G 7.6G 85% /
devtmpfs 486M 0 486M 0% /dev
tmpfs 497M 0 497M 0% /dev/shm
tmpfs 497M 6.6M 490M 2% /run
tmpfs 497M 0 497M 0% /sys/fs/cgroup
/dev/vda1 497M 354M 144M 72% /boot
tmpfs 100M 0 100M 0% /run/user/0
sudo service mysqld restart
Failed to restart mysqld.service: Unit not found.
mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak
service mysqld start
not working
systemctl start mariadb.service
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
● mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2017-04-06 10:13:18 JST; 4s ago
Process: 4191 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=1/FAILURE)
Process: 4190 ExecStart=/usr/bin/mysqld_safe --basedir=/usr (code=exited, status=0/SUCCESS)
Process: 4162 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
Main PID: 4190 (code=exited, status=0/SUCCESS)
systemctl status mariadb.service
Apr 06 10:13:15 mtserver.melon-tea.com systemd[1]: Starting MariaDB database server...
Apr 06 10:13:15 mtserver.melon-tea.com mysqld_safe[4190]: 170406 10:13:15 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
Apr 06 10:13:15 mtserver.melon-tea.com mysqld_safe[4190]: 170406 10:13:15 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Apr 06 10:13:18 mtserver.melon-tea.com systemd[1]: mariadb.service: control process exited, code=exited status=1
Apr 06 10:13:18 mtserver.melon-tea.com systemd[1]: Failed to start MariaDB database server.
Apr 06 10:13:18 mtserver.melon-tea.com systemd[1]: Unit mariadb.service entered failed state.
Apr 06 10:13:18 mtserver.melon-tea.com systemd[1]: mariadb.service failed.
some log file of /var/log/mariadb/mariadb.log
170406 10:13:44 [ERROR] Aborting
170406 10:13:44 InnoDB: Starting shutdown...
170406 10:13:45 InnoDB: Shutdown completed; log sequence number 348406146
170406 10:13:45 [Note] /usr/libexec/mysqld: Shutdown complete
170406 10:13:45 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
170406 10:26:09 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170406 10:26:09 [Note] /usr/libexec/mysqld (mysqld 5.5.52-MariaDB) starting as process 1514 ...
170406 10:26:09 [Warning] Can't create test file /var/lib/mysql/mtserver.lower-test
170406 10:26:09 InnoDB: The InnoDB memory heap is disabled
170406 10:26:09 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170406 10:26:09 InnoDB: Compressed tables use zlib 1.2.7
170406 10:26:09 InnoDB: Using Linux native AIO
170406 10:26:09 InnoDB: Initializing buffer pool, size = 128.0M
170406 10:26:09 InnoDB: Completed initialization of buffer pool
170406 10:26:09 InnoDB: highest supported file format is Barracuda.
170406 10:26:09 InnoDB: Waiting for the background threads to start
170406 10:26:10 Percona XtraDB (http://www.percona.com) 5.5.49-MariaDB-38.0 started; log sequence number 348406146
170406 10:26:10 [Note] Plugin 'FEEDBACK' is disabled.
170406 10:26:10 [Note] Server socket created on IP: '::1'.
170406 10:26:10 [ERROR] Can't start server : Bind on unix socket: Permission denied
170406 10:26:10 [ERROR] Do you already have another mysqld server running on socket: /var/lib/mysql/mysql.sock ?
170406 10:26:10 [ERROR] Aborting
maybe I did not shutdown linux normally yesterday
I try to reboot my vps but still not working.
when i type mysql in ssh, it said
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
How can I fix it?
Thanks
Critical Error: [0100] - Unable to connect or authenticate to the Sentora database (sentora_core).
We advice that you contact the server administrator to ensure that the database server is online and that the correct connection parameters are being used.
http://forums.sentora.org/showthread.php...mysql.sock
I try found this post but still can't fix it.
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 48G 40G 7.6G 85% /
devtmpfs 486M 0 486M 0% /dev
tmpfs 497M 0 497M 0% /dev/shm
tmpfs 497M 6.6M 490M 2% /run
tmpfs 497M 0 497M 0% /sys/fs/cgroup
/dev/vda1 497M 354M 144M 72% /boot
tmpfs 100M 0 100M 0% /run/user/0
sudo service mysqld restart
Failed to restart mysqld.service: Unit not found.
mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak
service mysqld start
not working
systemctl start mariadb.service
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
● mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2017-04-06 10:13:18 JST; 4s ago
Process: 4191 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=1/FAILURE)
Process: 4190 ExecStart=/usr/bin/mysqld_safe --basedir=/usr (code=exited, status=0/SUCCESS)
Process: 4162 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
Main PID: 4190 (code=exited, status=0/SUCCESS)
systemctl status mariadb.service
Apr 06 10:13:15 mtserver.melon-tea.com systemd[1]: Starting MariaDB database server...
Apr 06 10:13:15 mtserver.melon-tea.com mysqld_safe[4190]: 170406 10:13:15 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
Apr 06 10:13:15 mtserver.melon-tea.com mysqld_safe[4190]: 170406 10:13:15 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Apr 06 10:13:18 mtserver.melon-tea.com systemd[1]: mariadb.service: control process exited, code=exited status=1
Apr 06 10:13:18 mtserver.melon-tea.com systemd[1]: Failed to start MariaDB database server.
Apr 06 10:13:18 mtserver.melon-tea.com systemd[1]: Unit mariadb.service entered failed state.
Apr 06 10:13:18 mtserver.melon-tea.com systemd[1]: mariadb.service failed.
some log file of /var/log/mariadb/mariadb.log
170406 10:13:44 [ERROR] Aborting
170406 10:13:44 InnoDB: Starting shutdown...
170406 10:13:45 InnoDB: Shutdown completed; log sequence number 348406146
170406 10:13:45 [Note] /usr/libexec/mysqld: Shutdown complete
170406 10:13:45 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
170406 10:26:09 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170406 10:26:09 [Note] /usr/libexec/mysqld (mysqld 5.5.52-MariaDB) starting as process 1514 ...
170406 10:26:09 [Warning] Can't create test file /var/lib/mysql/mtserver.lower-test
170406 10:26:09 InnoDB: The InnoDB memory heap is disabled
170406 10:26:09 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170406 10:26:09 InnoDB: Compressed tables use zlib 1.2.7
170406 10:26:09 InnoDB: Using Linux native AIO
170406 10:26:09 InnoDB: Initializing buffer pool, size = 128.0M
170406 10:26:09 InnoDB: Completed initialization of buffer pool
170406 10:26:09 InnoDB: highest supported file format is Barracuda.
170406 10:26:09 InnoDB: Waiting for the background threads to start
170406 10:26:10 Percona XtraDB (http://www.percona.com) 5.5.49-MariaDB-38.0 started; log sequence number 348406146
170406 10:26:10 [Note] Plugin 'FEEDBACK' is disabled.
170406 10:26:10 [Note] Server socket created on IP: '::1'.
170406 10:26:10 [ERROR] Can't start server : Bind on unix socket: Permission denied
170406 10:26:10 [ERROR] Do you already have another mysqld server running on socket: /var/lib/mysql/mysql.sock ?
170406 10:26:10 [ERROR] Aborting