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 ";