Create a user and assign permissions to the mysql database
Record the process of creating a database user for the new application and assigning permissions to the new user.
(1) Create a database travel_db
Create database 'travel _ db' default character set utf8 COLLATE utf8_general_ci;
(2) create a new user travelUser1, which only allows the user to access the travel_db Database
Create user 'traveluser1 ';
Update mysql. user set password = password ('pwd123 #. o') where User = 'traveluser1 ';
Flush privileges;
Show grants for 'traveluser1 ';
Grant select, update, delete, insert on travel_db. * to 'traveluser1 ';
Flush privileges;
Show grants for 'traveluser1 ';
(3) set rijiAppUser to perform all operations on the travel_db Database
Flush privileges;
Grant all on travel_db. * to 'traveluser1 ';
Show grants for 'traveluser1 ';
For mysql user settings, refer to the article on this site:
Mysql user management and permission settings