简体   繁体   中英

I accidentally deleted the MySQL socket file ('/tmp/mysql.sock') permanently ,how can i fix it?

After that, I reinstalled mysql, but still got: Can't connect to Error: local MySQL server through socket'/tmp/mysql.sock'(2) .

Tried to start the server: start mysql.server , but got:

ERROR! The server quit without updating PID file (/usr/local/var/mysql/appledeMacBook-Pro-6.local.pid).

The next thing I tried was:

mysqladmin -h 127.0.0.1 -u root -p shutdown

and got:

mysqladmin: connect to server at '127.0.0.1' failed
error: 'Can't connect to MySQL server on '127.0.0.1' (61)'
Check that mysqld is running on 127.0.0.1 and that the port is 3306.
You can check this by doing 'telnet 127.0.0.1 3306'

I followed this tip (telnet 127.0.0.1 3306) and got:

connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host

How can I fix this?

  • ps aux | grep mysql
  • sudo kill -9 [PID]
  • sudo mysql.server start

我希望您尝试重新启动计算机,并希望您授予mysql正确的写入权限。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM