Linux restarts MYSQL command bitsCN.com
Linux command to restart MYSQL
I. startup mode
1. start with service: service mysqld start
2. use the mysqld script to start:/etc/inint. d/mysqld start
3. start with safe_mysqld: safe_mysqld &
II. stop
1. start with service: service mysqld stop
2. use the mysqld script to start:/etc/inint. d/mysqld stop
3. mysqladmin shutdown
3. restart
1. start with service: service mysqld restart
2. use the mysqld script to start:/etc/inint. d/mysqld restart
At the beginning, mysql was built with redhat. What is Startup/rc. d/init. d/start
This is very simple, but later I learned more and more about mysql, some of which 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. sock password 'Your. passwd'
Or make a connection.
Ln-s/var/lib/mysql. sock/tmp
In fact, the error message "/tmp/mysql. sock" is not found in the/tmp directory.
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 &
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 mysql is started normally. 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
/Usr/local/mysql/
Mysql 6395 0.0 1.5 10528 992 pts/3 S
/Usr/local/mysql/
Mysql 6396 0.0 1.5 10528 992 pts/3 S
/Usr/local/mysql/
Root 6422 0.0 1.1 2408 732 pts/3 S grep
Mysql
Check whether mysql is running the monitoring port command
Netstat-tl | grep mysql
You will see the following similar content
Tcp 0 0 *: mysql *: * LISTEN
BitsCN.com