Mysql commands on linux

Source: Internet
Author: User
Tags mysql commands
The operation of mysql on the linux platform is inevitable and will inevitably be used in the course of work. what is the company's requirement?

The operation of mysql on the linux platform is inevitable and will inevitably be used in the course of work. what is the company's requirement?

Below are some common commands to write down

1. how to start mysql in linux:
Mysqladmin start
/Ect/init. d/mysql start (the installation directory of mysql is the same below)

2. how to restart mysql in linux:
Mysqladmin restart
/Ect/init. d/mysql restart

3. how to disable the mysql command in linux:
Mysqladmin shutdown
/Ect/init. d/mysql shutdown

4. connect to mysql on the local machine:
Enter the mysql \ bin directory, type the mysql-uroot-p command, and press enter to enter the password.
Exit mysql command: exit

5. modify the mysql password:
Mysqladmin-u username-p old password new password
Or enter the mysql command line set password for root = PASSWORD ("root ");

6. add new users.
Grant select on database. * to username @ login host identified by "password"
For example, if a user's test password is added to 123, the user can log on to any host and have the permission to query, insert, modify, and delete all databases.

First, it is used as the root user.
Log on to mysql with the highest permission, and then type the following command:
Grant select, insert, update, delete on *. * to "Identified by" 123 ";

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.