SOHO : Small Office Home Office
Freeware - Opensource software tips, tricks, tweaks & fixes for managing, securing, improving the performance of SOHO Desktop, Laptop, Networks

Tuesday, September 15, 2020

Mysql (adminer) : error "Access denied for user 'root'@'localhost'(using password :yes)

  •  Server

 ubuntu 18.04LTS

  • Mysql 

mysql-server v5.7


  • Error: 
image

  • edit mysql config file

sudo nano /etc/mysql/my.cnf

  • Add to my.cnf

[mysqld]

skip-grant-tables

  • restart mysql

sudo systemctl restart mysql

  • login to mysql and run command

$ mysql -u root 

UPDATE mysql.user SET authentication_string=PASSWORD('YOURNEWPASSWORD'), plugin='mysql_native_password' WHERE User='root';

exit;

  • disable the added lines from my.cnf

#[mysqld]

#skip-grant-tables

  • Restart mysql 

sudo systemctl restart mysql

  • Run mysql_secure_installation and set 'y' for all options

sudo mysql_secure_installation

  • check login to mysql 

mysql -u root -p  

Now login to mysql as user root with new password must be possible.




No comments:

Post a Comment