In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
In this issue, the editor will bring you what is the command for Linux to restart MySQL. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
Mysql as an open source relational database is used by many friends, some friends installed MySQL in Linux but do not know how to start, the following will explain the command tutorial of MySQL.
I. start-up mode
1. Start with service: service mysqld start
2. Start with mysqld script: / etc/inint.d/mysqld start
3. Start with safe_mysqld: safe_mysqld&
2. Stop
1. Start with service: service mysqld stop
2. Start with mysqld script: / etc/inint.d/mysqld stop
3 、 mysqladmin shutdown
3. Restart
1. Start with service: service mysqld restart
2. Start with mysqld script: / etc/inint.d/mysqld restart
Editor's summary of questions
How to start / stop / restart MySQL
I. start-up mode
1. Start with service: service mysqld start
2. Start with mysqld script: / etc/inint.d/mysqld start
3. Start with safe_mysqld: safe_mysqld&
2. Stop
1. Start with service: service mysqld stop
2. Start with mysqld script: / etc/inint.d/mysqld stop
3 、 mysqladmin shutdown
3. Restart
1. Start with service: service mysqld restart
2. Start with mysqld script: / etc/inint.d/mysqld restart
When I first started learning mysql, I used redhat to bring it with me. What is startup / rc.d/init.d/ start
This is very simple, but later more and more, the system comes with mysql, some versions are too low, some are related to
The lower version of mysql required by the web service you want to install
Later, I learned to install mysql in the way of tar, and my mysql was installed in the / usr/local/mysql directory.
I have encountered a lot of problems in moving. The most common ones are:
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 prompt can not find / tmp/mysql.sock, sometimes it is not / tmp directory does not have this file, it is started
The orders are wrong. I've come across them.
Several common startup methods, I do not remember very clearly, if you are sure that there is a mysql.sock under tmp
Try a few other commands for a file
/ 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 & it means that mysql is running in the background) I will make a mistake.
STOPPING server from pid file
/ usr/local/mysql/data/localhost.localdomain.pid
060304 11:46:21 mysqld ended
This is a question of permissions. My mysql directory belongs to both root users and root groups. It's no problem to start with mysqld_safe instead.
You just need to pay attention to these mysql,safe_mysqld,mysqld_safe,mysqld,mysqladmin. Multi-try
Several times
In fact, sometimes mysql is already started, to see if mysql starts the command.
Ps-aux | grep mysqld
You will see something similar to the following
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 to see if mysql is listening for port commands
Netstat-tl | grep mysql
You will see something similar to the following
Tcp 0 0 *: mysql *: * LISTEN
This is what the editor shares with you about the command for Linux to restart MySQL. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.