In this tutorial, we are going to add a new user in MySQL and grant different types of privileges on a MySQL database.

MySQL server allows us to create numerous user accounts and grant appropriate privileges so that the users can access and manage databases. Once you have MySQL installed on the server, you need to create a database and additional user accounts.

In order to run the following commands, first you need to log into the MySQL Server with the MySQL root account.

mysql -u root -p

How to Create a New MySQL User

The CREATE USER statement creates a new user in the MySQL database server. Here is the basic syntax of the statement:

CREATE USER 'username'@'hostname' IDENTIFIED BY 'password';

In the syntax above, make sure to replace the username and password with your desired username and password.

#databases #mariadb #mysql #mysql user

How to Add a New MySQL User and Grant Access Privileges
1.50 GEEK