First of all, to declare: In general, to modify the MySQL password, authorization, is required to have the root authority in MySQL. Note: This operation is also available at the win command prompt, phpMyAdmin. User: RDINGCN user database: rdingcnDB1. New user. Login mysql@>mysql-u root-p@> Password//create user mysql> insert into Mysql.user (Host,user,password) VALUES ("localhost", " RDINGCN ", Password (" 1234 "));//Refresh the System permissions table Mysql>flush privileges; This creates a user named: rdingcn Password: 1234. Then log in. Mysql>exit;@>mysql-u phplamp-p@> Enter password mysql> login success 2. Authorize the user. Log in to MySQL (with root privileges). I am logged in as root. @>mysql-u root-p@> Password//First create a database for the user (RDINGCNDB) mysql>create db rdingcndb;// Authorizes the Phplamp user to have all the permissions of the RDINGCN database. >grant all privileges in rdingcndb.* to [email protected] identified by ' 1234 ';//Refresh System Permissions Table Mysql>flush privileges;mysql> other actions 3. Delete the user. @>mysql-u root-p@> password mysql>delete from user WHERE user= "RDINGCN" and host= "localhost"; mysql>flush privileges;//Delete the user's database Mysql>drop rdingcndb;4. Modify the specified user password. @>mysql-u root-p@> password mysql>update mysql.user set Password=password (' New password ') where user= "RDINGCN" and Host= " localhost "; mySql>flush privileges;
MySQL new user, authorization, delete user, modify password summary