Set root password, enable root user for socket and http access

Download mysql eBook

Example

Solves problem of: access denied for user root using password YES Stop mySQL:

sudo systemctl stop mysql

Restart mySQL, skipping grant tables:

sudo mysqld_safe --skip-grant-tables

Login:

mysql -u root

In SQL shell, look if users exist:

select User, password,plugin FROM mysql.user ;

Update the users (plugin null enables for all plugins):

update mysql.user set password=PASSWORD('mypassword'), plugin = NULL WHERE User = 'root';
exit;

In Unix shell stop mySQL without grant tables, then restart with grant tables:

sudo service mysql stop
sudo service mysql start

Stats

Contributors: 2
2017-05-16
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook