Linux Command to restart MYSQL

Source: Internet
Author: User

Linux Command to restart MYSQL 1. startup method 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 comes with redhat at the beginning of mysql learning. What is startup/rc. d/init. d/start is very simple, but the more I learned later, the mysql that comes with the system, some of which have a low version, some of them are mysql of the lower version required by the web service that you want to install. Later, you learned to install mysql in tar, I encountered many problems when installing mysql in the/usr/local/mysql directory. The most common ERROR 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 connect ln-s/var/lib/mysql. sock/tmp actually prompts that/tmp/mysql cannot be found. sock sometimes does not have this file in the/tmp directory, but the startup command is incorrect. I have encountered several common startup methods, and I do not remember them clearly, if you are sure there is mysql under tmp. the sock file may try several 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 = mysql &/usr/local/mysql/bin/safe_mysqld -- uer = root & (note that safe_mysqld is different from mysqld_safe, & indicates that mysql runs in the background.) The STOPPING server from pid file/usr/local/mysql/data/localhost error is returned. 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. It is okay to start it with mysqld_safe. You only need to pay attention to these mysql, safe_mysqld, mysqld_safe, mysqld, mysqladmin. try multiple times. Sometimes mysql is started normally, check whether mysql starts the command ps-aux | grep mysqld. The following similar content is displayed: mysql 6394 0.0 1.5 10528 992 pts/3 S/usr/local/mysql 6395 0.0 1.5 10528 992 pts/3 S/usr/local/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 in monitoring PORT command netstat-tl | grep mysql will see the following similar content tcp 0 0 *: mysql *: * LISTEN

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.