При попытке локального коннекта или через phpmyadmin мы получим:
#1045 - Access denied for user 'root'@'localhost' (using password: YES)
Выход из данной ситуации:
1. Стопаем мускул
#/etc/init.d/mysql stop
2. Запускаем MySQL сервер без проверки привилегий:
#mysqld_safe --skip-grant-tables &
3. Смотрим что к чему привязано
#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> select host, user from user;
+---------------+------------------+
| host | user |
+---------------+------------------+
| 127.0.0.1 | root |
| 20x.4x.5x.1x | root |
| localhost | debian-sys-maint |
| localhost | schedule |
| nsxx | root |
+---------------+------------------+
5 rows in set (0.00 sec)
4. Исправляем ошибку. Разрешаем коннекты с любого хоста:
update user set host=’%’ where user=’root’ and host=’20x.4x.5x.1x’;
или только с локалхоста:
update user set host=’localhost’ where user=’root’ and host=’20x.4x.5x.1x’;
5. перегружаем привилегии
flush privileges;
6.Выходим из mysql клиента выполнив в нем команду
exit
7.Перегружаем mysql сервер.
service mysqld restart
Комментариев нет:
Отправить комментарий