Timeout error occurred trying to start MySQL Daemon
I just installed mySQL server on a brand new dedicated server and am getting Timeout error occurred trying to start MySQL Daemon. I have uninstalled and reinstalled it a few times and am still getting the same error.
When connecting to a MySQL server located on the local system, the mysql client connects through a local file called a socket instead of connecting to the localhost loopback address 127.0.0.1. For the mysql client, the default location of this socket file is /tmp/mysql.sock. But sometimes many MySQL installations place this socket file somewhere else like /var/lib/mysql/mysql.sock.
While it is possible to make this work by specifying the socket file directly in the mysql client command
it is not practical to type this in every time. If you must do so this way (because you don’t have permissions to the file in the solution below), you could create an alias in your shell to make this work (like alias mysql=”mysql –socket=/var/lib/mysql/mysql.sock” depending on your shell).
It will be easy if you can make a simple change to the MySQL configuration file /etc/my.cnf that will permanently set the socket file used by the mysql client. After making a backup copy of /etc/my.cnf, open it in your favorite editor. The file is divided into sections such as
If there is not currently a section called [client], add one at the bottom of the file and copy the socket= line under the [mysqld] section such as:
If there is already a [client] section in the my.cnf file, add or edit the socket line as appropriate. You won’t need to restart your server or any other processes. Subsequent uses of the mysql client will use the proper socket file.