MYSQL Access denied for user 'root'@'localhost' -
i did following steps use mysql in ubuntu:
sudo aptitude install php5-mysql mysql-server sudo service mysql stop sudo mysqld_safe --skip-grant-tables & sudo mysql -u root mysql
change root password:
mysql> update mysql.user set password=password('securepassword') user='root'; mysql> flush privileges; mysql> exit
modify /etc/mysql/my.cnf:
[client] user=root password=securepassword [mysqld] ... default-time-zone = '+0:00'
then:
sudo service mysql start mysql -u root mysql> show grants root@localhost +--------------------------------------------------------------------------------------------------+ | grants root@localhost | +--------------------------------------------------------------------------------------------------+ | grant usage on *.* 'root'@'localhost' identified password '[here securepassword]' | +-------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec) mysql> grant privileges on *.* 'root'@'localhost' grant option;
and receive error:
access denied user 'root'@'localhost' (using password: yes)
it absolutely correct did, guess it's not working 1 small reason.
you should use identified password
when going grant privileges this:
mysql> grant privileges 1 `*`.`*` 'root'@'localhost' identified password '*a4b6157319038724e3560894f7f932c8886ebfcf' grant option;
Comments
Post a Comment