Buy best selling Linux books

<< View More Computer Tips

Added On: 28/11/15   |    Category: MySQL    |    Number of Views: 990

Create a new user, assign all privileges using MySQL / MariaDB using Linux   

Note: This tutorials assumes you are using Linux and that you have already installed MySQL / MariaDB server.

For tutorial purposes I use simple passwords in my examples, it goes without saying you would not assign these sorts of passwords for real database applications.

To create a new user in MySQL first login to MySQL / MariaDB Database with your root username and password at the terminal by entering the following command
mysql -u root -p

Next we need to create a new user and assign that new user with a password. In the terminal enter the following command.
(We are creating a new user named linuxuser with password 12345678)
CREATE USER linuxuser@localhost IDENTIFIED BY 12345678;

Next we need to assign linuxuser with ALL PRIVILEGES. This means linuxuser can CREATE, UPDATE and perform many other functions.
GRANT ALL PRIVILEGES ON * . * TO linuxuser@localhost;

The account linuxuser has now been created. Next logout of MySQL / MariaDB by entering the exit command

Now we can login as linuxuser and enter the password we created earlier to access MySQL / MariaDB, by entering the following command.
mysql -u linuxuser -p

In the next article I will create a new database, fields and query the database for linuxuser

Search Site

Search other tutorials and tips on My Computer Tips by entering your search terms below


The Linux Foundation

Best selling Unix / Linux books
Nvidia Graphics Cards
Save 15% off .CO.UK domains at 123-Reg
Save 15% off .COM domains at 123-Reg
cPanel Hosting Plans
Xilo Web Hosting Plans