First, modify the user password
Format (input at command line): Mysqladmin-u User Name----old password password new password
1. Add a password to root Ab12:mysqladmin-uroot-password ab12
2. Change the root password to djg345:mysqladmin-uroot-pab12 password djg345
Second, add new users
Format: Grant permission on the database name. Table name to User name @ login host identified by "password"
1. Add a user test1 password to ABC, so that he can log on any host, and all databases have query, insert, modify, delete permissions. First, use the root user to connect to MySQL, and then type the following command:
Grant SELECT, INSERT, UPDATE, delete on *. * to [email protected] '% ' identified by ' ABC ';
2. Add a user test2 password to ABC, so that he can only login on localhost, and the database mydb can be queried, inserted, modified, deleted operations (localhost refers to the local host, that is, the MySQL database is located on the host), This allows the user to use a password that knows test2, and he cannot access the database directly from the Internet, but only through a Web page on the MySQL host.
Grant Select, inset, update, delete on mydb.* to [e-mail protected] indetified by "ABC";
If you do not want to test2 have a password, you can enter a command again to cancel the password:
Grant SELECT, INSERT, UPDATE, delete on mydb.* to [e-mail protected] identified by "";