Play MySQL Linux simple operation (service start and close, start and close, view version)

Source: Internet
Author: User
Tags mysql version

The younger brother today records the simple use of MySQL below the Linux system, as follows:

    1. service startup and shutdown
    2. start and close
    3. View version

Environment

Linux version: Centeros 6.6 (demo below), Ubuntu 12.04 (see the article at the end of the Red label font)

MySQL version: 5.1.73

To view the startup status of the MySQL service,

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

or: service mysqld Status

Example diagram:


Or


Then start the MySQL service,

Enter the command: Service mysqld Start

or: /etc/init.d/mysqld start

Example diagram:


Or


The discovery failed to start, this is due to not using administrator state to start, the following switch to the administrator state to try again,

Example diagram:


Then log in,

Input command:mysql–uroot–p123456(123456 for password)

Or: mysql–uroot-p(enter, then password)

Example diagram:


View MySQL version,

Enter the command: select version ();

Example diagram:


Quit (Close) MySQL,

Enter the command: Exit

Example diagram:


Close the service,

Enter the command: service mysqld Stop

or: /etc/init.d/mysqld stop

Example diagram:


Or


Note: The above is done under the Center OS system, the younger brother in the Ubuntu system is also tested, unlike the center OS, Ubuntu need to use the Center OS inside the command of the mysqld behind the D removed, All of the commands shown above can be replaced with MySQL directly using mysqld.


Reprint Please specify source: http://blog.csdn.net/yannanying/article/details/43087143

Play MySQL Linux simple operation (service start and close, start and close, view version)

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.