Create a new user and authorize MySQL
- Syntax for creating a user:
Create user 'username' @ host [Identified by [password] 'Password'];
Example:
Create user 'teacher' @ 'localhost' identified by '20140901', or
Create user 'teacher' @ 'localhost (no password)
- Run grant (Grant permissions at the same time)Create user
Syntax:
Grant priv_type on database or data table to username @ localhost (or IP address) identified by '20140901 ';
- Use mysql AdminModify rootAccount Password
- Syntax:
Mysqladmin-u root-p password "123 ";
Enter password: the original password (root );
- Use setPASSWORD command to change the password of a common user (mysqlCommand)
Syntax:
Set password = password ("000"); // modify the current user password
Set password for teacher @ localhost = password ("123"); // modify the password of the specified account
Drop user 'studentr' @ localhost;