Creating MySQL users

You can create MySQL users either from Command Prompt or by using MySQL Workbench:

  1. To execute SQL and other commands from Command Prompt, open the Terminal and type the following command:
mysql -u root -p<root_password> 
  1. Once logged in successfully, you will see the mysql Command Prompt:
mysql>  
  1. 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 user can access the server from any host.


See https://dev.mysql.com/doc/refman/5.7/en/adding-users.html for more details on adding users to MySQL database

If you prefer a graphical user interface (GUI) to manage the users, then run MySQL Workbench, connect to the local MySQL server (see Figure 1.13 MySQL Workbench connections), and then click on Users and Privileges under the Management section:

Figure 1.16: Creating a user in MySQL Workbench

Having installed all the preceding products, you should be in a position to start developing JEE applications. We may need some additional software, but we will see how to install and configure it at the appropriate time.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.87.161