Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

MySQL5.5 shuts down the database and reports an error & what about quot;Can't connect to local MySQL server through socket"

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the relevant knowledge of "MySQL5.5 shutting down the database and reporting errors" and "how to do Can't connect to local MySQL server through socket". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

MySQL 5.5 shut down the database and report an error

[root@localhost] # / software/bin/mysqladmin-usystem-paired system 'shutdown

/ software/bin/mysqladmin: connect to server at 'localhost' failed

Error: 'Can't connect to local MySQL server through socket' / cluster_data/mysql.sock' (2)'

Check that mysqld is running and that the socket:'/ cluster_data/mysql.sock' exists!

Reason for reporting an error:

The database has used other socket before

Solution:

Specify the existing socket name in the shutdown database command parameter

View existing socket

[root@localhost ~] # ps-ef | grep mysql

Root 2487 2462 0 08:13? 00:00:00 / bin/sh / software/bin/mysqld_safe-- defaults-file=/mysql_data/cnf/my.cnf

Mysql 3057 2487 0 08:14 00:00:00 / software/bin/mysqld-- defaults-file=/mysql_data/cnf/my.cnf-- basedir=/software-- datadir=/mysql_data/70005-- plugin-dir=/software/lib/plugin-- user=mysql-- log-error=/mysql_log/err.log-- open-files-limit=10240-- pid-file=/mysql_data/70005/mysqld.pid-- socket=/mysql_data/70005/mysql.sock-- port=55057

Root 3092 3026 0 08:14 pts/1 00:00:00 grep mysql

[root@localhost ~] # / software/bin/mysqladmin -? | grep sock

-- protocol=name The protocol to use for connection (tcp, socket, pipe

-S,-- socket=name The socket file to use for connection.

Socket / cluster_data/mysql.sock

Shut down the database normally

[root@localhost] # / software/bin/mysqladmin-usystem-paired system 'shutdown-- socket=//mysql_data/70005/mysql.sock

"MySQL5.5 shut down the database error report" Can't connect to local MySQL server through socket "what to do" content is introduced here, thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report