Category: MariaDB Database

Added: 30th of June 2019

Viewed: 1096 times

Create a new user using MariaDB database in the Linux Terminal


This is a four part series of tutorials.


If you haven't installed MariaDB, please go back to Part 1 using the drop down menu above.



The next thing we need to do is create a new user. You can create as many users as you like, with each user being able to login to MariaDB and create new database(s).

If you have ever used CPanel to create a new database with a new user, this is the very same thing but using the terminal.

To create a new user in MariaDB, first we need to login to MariaDB as root.

mysql -u root -p


Now we need to create a new user. In the terminal enter the following command.
CREATE USER 'mycomputertips'@'localhost' IDENTIFIED BY '12345';


We have just created a new user named mycomputertips with password 12345. You wouldn't use 12345 in real life, but for learning purposes we keep it simple.

If you want user mycomputertips to be able to CREATE, UPDATE, DELETE and perform other database operations, we need to grant mycomputertips all privileges.

In the terminal enter the following command
GRANT ALL PRIVILEGES ON * . * TO mycomputertips@localhost;


User mycomputertips has now been granted all privileges.

To login as user mycomputertips and create your first database enter the following command to exit MariaDB
exit


Then login as user mycomputertips and when prompted enter your password 12345
mysql -u mycomputertips -p

Other Tips & Tutorials

MariaDB Database

Perform basic SELECT queries in MariaDB using the Linux Terminal

Posted: 15th of September 2019

Views: 789

MariaDB Database

Create a new database, table and insert data, using MariaDB in the Linux Terminal

Posted: 12th of September 2019

Views: 749

MariaDB Database

Create a new user using MariaDB database in the Linux Terminal

Posted: 30th of June 2019

Views: 1096

MariaDB Database

Install MariaDB database in Ubuntu based distributions 2019

Posted: 16th of June 2019

Views: 1143

MariaDB Database

Create a new user in MariaDB and GRANT ALL privileges (Part 2)

Posted: 28th of May 2018

Views: 1182