[RISOLTO] Mysql password di root persa

19/06/2008 by - Mysql, [RISOLTO]

texilee:/# mysql
ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO)
texilee:/# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)
texilee:/# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)

texilee:/# /etc/init.d/mysql stop
Stopping MySQL database server: mysqld.

texilee:/# mysqld_safe –skip-grant-tables &
[1] 29756
texilee:/## Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[29793]: started

texilee:/# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.32-Debian_7etch5-log Debian etch distribution

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> update user set password=PASSWORD(‘__NEW__PASSWORD__’) where User=’root’;
Query OK, 2 rows affected (0.02 sec)
Rows matched: 2 Changed: 2 Warnings: 0

mysql>
mysql>
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> \q
Bye

texilee:/# kill 29756 && /etc/init.d/mysql start