You can create MySQL users either from Command Prompt or by using MySQL Workbench:
- To execute SQL and other commands from Command Prompt, open the Terminal and type the following command:
mysql -u root -p<root_password>
- Once logged in successfully, you will see the mysql Command Prompt:
mysql>
- To create a user, first select the mysql database:
mysql>use mysql; Database changed mysql>create user 'user1'@'%' identified by 'user1_pass'; mysql>grant all privileges on *.* to 'user1'@'%' with grant option
The preceding command will create a user named 'user1' with password 'user1_pass' having all privileges, for example to insert, update, and select from the database. And because we have specified the host as '%', this ...