Missing /var/lib/mysql/mysql.sock file

前端 未结 8 1261
忘掉有多难
忘掉有多难 2021-02-18 14:22

I\'m trying to access mysql and when I run the mysql command, I get the following.

[root@ip-10-229-65-166 tpdatabase-1.8.0.28356]# mysql

ERR

相关标签:
8条回答
  • 2021-02-18 14:33
    rm -rvf /var/lib/mysql/ib_logfile*
    touch /var/lib/mysql/mysql.sock
    touch /var/lib/mysql/mysql.pid
    chown -R mysql:mysql /var/lib/mysql
    systemctl restart mysql
    

    try this and check the permission of both /var/lib/mysql/mysql.sock and /tmp

    0 讨论(0)
  • 2021-02-18 14:37

    just search for mysqld, this is the server daemon:

    find / | grep mysqld
    

    If you found it, the server package may be correctly installed but without initd scripts. For testing, you may start the mysql server by hand executing the above file.

    0 讨论(0)
  • 2021-02-18 14:46

    Before hitting mysql on command prompt make sure your correct my.cnf configuration file is in placed and set the permission of etc folder as

    chmod -R 777

    etc folder as below list to avoid

    error MySQL - ERROR 2002 (HY000): e.g /etc/my.cnf, /etc/mysql/my.cnf, $MYSQL_HOME/my.cnf [datadir]/my.cnf ~/.my.cnf

    0 讨论(0)
  • 2021-02-18 14:47

    I recently encountered this problem after an upgrade on Ubuntu 18.04. The solution here solved it https://serverfault.com/a/957723/439448.

    0 讨论(0)
  • 2021-02-18 14:49

    We faced a similar problem in my office setup with the same OS. The actual thing that was happening was low space on the server. It is quite strange, but i believe if the server gets full the files cannot be loaded or of some other resort. Please check to be sure the space on the server is enough else you have to try removing the installed mysql and reinstall. Best of luck.

    0 讨论(0)
  • 2021-02-18 14:51

    mysql might have been packaged separately as client and server. Check your package repositories to make sure that the server has been installed. The mysql package might only be the client. Check if there's a package called mysql-server or something similar. Check the list of files installed by the mysql package to see if it actually installs the server.

    If the files are not even there, it's not a permissions problem. Also, you're running as root.

    0 讨论(0)
提交回复
热议问题