mysql howto

This document was created when using Linux Mint , but should work in all Linux distributions.

$ sudo apt update
$ sudo apt install mysql-server
$ mysql --version
$ sudo systemctl status mysql
$ sudo mysql_secure_installation

If below error occurs, solve it first as per exerror website, then re-issue this command again.

Error Message:

Failed! Error: SET PASSWORD has no significance for user β€˜root’@’localhost’ as the authentication method used doesn’t store authentication data in the MySQL server. Please consider using ALTER USER instead if you want to change authentication parameters.

sudo MySQL Then run This ALTER Query to change the authentication parameters: ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password by ‘mynewpassword’; And now, you are able to run mysql_secure_installation command: sudo mysql_secure_installation Now, Your error must be solved. Thanks.

ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password by ‘@nIruth03’;

$ sudo mysql_secure_installation(complete the steps as per linuxhint
tutorial)

$ sudo mysql (if below error occurs, re-issue the below command after
the error message as per stackoverflow website)

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using
password: NO)

mysql -u root -p

mysql>CREATE USER aniruth@'localhost' IDENTIFIED BY '@nIruth03';

mysql>GRANT ALL PRIVILEGES ON *. * TO aniruth@'localhost';

mysql> flush privileges;

$ mysql -u aniruth --p

Contiue testing as per linuxhint article

Sources:


Β© Prabu Anand K 2020-2026