Ubuntu mysql service will not run. (Error HY000)

Asked 2 years ago, Updated 2 years ago, 135 views

Hi, everyone. We run a simple DB server using Ubuntu, node.js, and mysql on AWS.

It's okay to reboot for about 3~4 days, but if you reboot after that, you'll get a HY000 error and be unable to enter mysql service.ql service. If you do ps-ef, the mysql service is running. It can be accessed from outside with tools such as Workbench, but it cannot be accessed from inside with mysql command. The mysql module in node.js is also inaccessible and the server is down.

Below is mysql from the terminal to the root account.

#mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
#ps -ef
..(omitted)
mysql   4617 1 0 12:09 ? 00:00:00 /usr/sbin/mysqld
..(omitted)

There is no problem with rebooting for 3~4 days, but this problem occurs if you reboot after that. Googling couldn't solve itㅠ<

The /etc/mysql/my.cnf file says:

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
bind-address=0.0.0.0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

Because the server is small and there is no other way to solve it, we are working on creating a new server whenever we have a problem Every time I make a new server, there's also AWS capacity issues. It's going well, but it's all of a sudden, so I'm flustered every time.

If you tell me what additional parts you need (such as what's in the directory), I'll write them down.

ubuntu mysql service hy000

2022-09-22 20:24

1 Answers

mysql -u DB account name -p-S /var/lib/mysql/mysql.sock

Try logging in this way.


2022-09-22 20:24

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.