This article mainly describes the actual operation solution for MySQL database startup in the linux operating system. When learning MySQL databases, redhat is used. So is it started? This is simple, but later I learned more.
Some of the MySQL instances that come with the system are too low, some are
The earlier MySQL version required for the web service that you want to install
Later, I learned to install MySQL in tar. My MySQL is installed in the/usr/local/MySQL directory to start
I have encountered many problems. The most common is:
- ERROR 2002: Can't connect to local MySQL server through socket
- '/tmp/MySQL.sock' (111)
Solution:
- [root@test MySQL]# /usr/local/MySQL/bin/MySQLadmin -u root /
- > -S /var/lib/MySQL/MySQL.sock password 'your.passwd'
Or make a connection.
- ln -s /var/lib/MySQL/MySQL.sock /tmp
In fact, the error message "/tmp/MySQL. sock" is not found in the/tmp directory. It is started by the MySQL database.
The command is incorrect. I have encountered
Several Common Startup methods are not clearly remembered. If you are sure that MySQL. sock is available under tmp
File. Try other commands.
- /usr/local/MySQL/bin/MySQL -u root -p
- /usr/local/MySQL/bin/MySQLd --user=MySQL&
- /usr/local/MySQL/bin/MySQLd --user=root&
- /usr/local/MySQL/bin/MySQLd_safe --user=root&
- /usr/local/MySQL/bin/MySQLd_safe --user=MySQL&
- /usr/local/MySQL/bin/safe_MySQLd--uer=root&
(Note that safe_MySQLd is different from MySQLd_safe, indicating that MySQL runs in the background.) I will report an error.
- STOPPING server from pid file
- /usr/local/MySQL/data/localhost.localdomain.pid
- 060304 11:46:21 MySQLd ended
This is a permission issue. My MySQL directory belongs to the root user and also belongs to the root group. You can use MySQLd_safe to start MySQL,
You only need to pay attention to these MySQL, safe_MySQLd, MySQLd_safe, MySQLd, and MySQLadmin. Try multiple times.
Times
In fact, sometimes the MySQL database is started normally and check whether MySQL has started the command.
Ps-aux | grep MySQLd
You will see the following similar content
- MySQL 6394 0.0 1.5 10528 992 pts/3 S 16:16 0:00
- /usr/local/MySQL/
- MySQL 6395 0.0 1.5 10528 992 pts/3 S 16:16 0:00
- /usr/local/MySQL/
- MySQL 6396 0.0 1.5 10528 992 pts/3 S 16:16 0:00
- /usr/local/MySQL/
- root 6422 0.0 1.1 2408 732 pts/3 S 16:20 0:00 grep
- MySQL
Check whether MySQL is listening for port commands
- netstat -tl | grep MySQL
You will see the following similar content
- tcp 0 0 *:MySQL *:* LISTEN
The above content is an introduction to the MySQL database startup problem in linux. I hope you will have some gains.