1. mysql Add new User:
Insert into Mysql.user (host,user,password,ssl_cipher,x509_issuer,x509_subject) VALUES ("xx.xx.xx.xx", "XIAOMIN.WXM" , Password ("WXM"), ', ', ', '); Query OK, 1 row affected (0.10 sec)
2. Authorize the user.
//log in to MySQL (with root access). I am logged in as root.
@>mysql-u root-p
@> Password
//First create a database for the user (phplampdb)
mysql>create database phplampdb;
//Authorize Phplamp user to have all rights to the Phplamp database.
>grant all privileges in phplampdb.* to [e-mail protected] identified by ' 1234 ';
//Refresh System Permissions Table
Mysql>flush privileges;
mysql> Other Operations
3. Delete the user.
@>mysql-u root-p
@> Password
mysql>delete from user Where user= "phplamp" and host= "localhost";
Mysql>flush privileges;
//Delete a user's database
mysql>drop database phplampdb;
4. Modify the specified user password.
@>mysql-u root-p
@> Password
mysql>update Mysql.user Set Password=password (' New password ') where user= "Phplamp" and host= "localhost";
Mysql>flush privileges;
5. List all databases
mysql>show database;
6. Switching the database
mysql>use ' database name ';
7. List all Tables
mysql>show tables;
8. Display the data table structure
mysql>describe table name;
9. Deleting databases and data tables
mysql>drop database name;
mysql>drop table Data sheet name;
MySQL add user, Authorization, change password and other statements