Simple operations in MySQL Linux (Service Startup and shutdown, startup and shutdown, view version), mysqllinux

Source: Internet
Author: User

Simple operations in MySQL Linux (Service Startup and shutdown, startup and shutdown, view version), mysqllinux

Today, the younger brother recorded the simple use of MySQL in the Linux system, as follows:

Environment

Linux: centeros 6.6 (as shown below) and Ubuntu 12.04 (see red font at the end of the article)

MySQL version: 5.1.73

View the MySQL service startup status,

Enter the command:/etc/init. d/mysqld status

Or: service mysqld status

Example:


Or


Start the MySQL service,

Enter the command: service mysqld start

Or:/etc/init. d/mysqld start

Example:


Or


Failed to start because the Administrator status is not used for startup. Next, switch to the Administrator status and try again,

Example:


Then log on,

Run mysql-uroot-p123456 (123456 is the password)

Or: mysql-uroot-p (Press enter and enter the password)

Example:


View MySQL version,

Enter the command: select version ();

Example:


Exit (close) MySQL,

Enter the command: exit

Example:


Close the service,

Enter the command: service mysqld stop

Or:/etc/init. d/mysqld stop

Example:


Or


 

Note: The above operations are carried out in the center OS system, and the younger brother has also conducted tests in the Ubuntu system. Unlike the center OS system, in Ubuntu, remove the d following mysqld in the Command Used in the center OS. All the commands shown above can replace mysqld directly with mysql.


Reprinted please indicate the source: http://blog.csdn.net/yannanying/article/details/43087143

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.