Home>
#vi mysqlusers.txt
create database dataname;
grant all privileges on dataname. * to [email protected] identified by "password";
flush privileges;
#/usr/local/mysql/bin/mysql -u root -p password<mysqlusers.txt

The blue italics are the corresponding username and password.Add multiple users and databases,Just copy the middle code and modify the corresponding position,Such as:

Create database dataname1;
Grant all privileges on dataname1. * To username1>@localhost "identified by" password ";
Flush privileges;
Create database dataname2;
Grant all privileges on dataname2. * To username2>@localhost "identified by" password ";
Flush privileges;

The above content has shared with you the speed of adding multi-user and database skills to mysql by reading and executing commands through documents.Hope you like it,Regarding the contents of the database, please continue to pay attention to this site,This site is updated daily with new content