Add a user in mysql as follows: 1 use the root user login mysql-uroot-p2 select mysql database usemysql3 Add User insertintou
To add a user to mysql, use the following method: 1. log on to mysql-u root-p using the root user; 2. Select mysql database use mysql 3 and add the user insert into u.
To add a user to mysql, follow these steps:
1. Log On with the root user
Mysql-u root-p
2. Select mysql database
Use mysql
3. Add a user
Insert into user (Host, User, Password) values ("localhost", "your username", password ("your Password "));
Replace Chinese characters with the user name or password you want to use
4. Refresh the MySQL system permission table
Flush privileges;
Add permissions to users:
Assume that I have a database named ysou and a user named honest. I want honest to have all the permissions (add, delete, modify, and query) for all tables in ysou,
The procedure is as follows:
1. Log On with the root user
Mysql-u root-p
2. Add Permissions
Grant all on ysou. * to honest;
3. log out of the root account and use honest to log on to mysql. Use show databases to View tables that can be operated by the current honest account. Of course, you can access the corresponding database to perform operations.
This is only the full authorization of the database. Of course, you can also authorize some operations separately. Click the link for the specific grant.