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:

Services start and close view versions started and closed

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,

Input command:/ETC/INIT.D/MYSQLD status

Or: Service mysqld status

Example diagram:

Or

Then start the MySQL service,

Input 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,

Input command: Select version ();

Example diagram:

Quit (Close) MySQL,

Input command: Exit

Example diagram:

Close the service,

Input 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.

Article from: http://www.2cto.com/database/201501/372605.html

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

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.