MySQL не зайти под рутом

Обсуждение настройки и работы сервисов, резервирования, сетевых настроек и вопросов безопасности ОС.

Модераторы: SLEDopit, Модераторы разделов

Kirizel
Сообщения: 2
ОС: GNU/Linux

MySQL не зайти под рутом

Сообщение Kirizel »

Здравствуйте! У меня такая проблема, что я, после того как создал нового пользователя в PMA, больше не могу зайти под рутом, ругается на неправильный пароль.
Пробовал восстанавливать пароль по этому ману http://wiki.archlinux.org/index.php/MySQL#...e_Root_Password
Но это не помогает.

Вот выхлоп:

Код: Выделить всё

[root@my-desktop mypc]# mysql -u root mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

[root@my-desktop mypc]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)



Вот как пытался восстановить:

Код: Выделить всё

[root@my-desktop mypc]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)


[root@my-desktop mypc]# /etc/rc.d/mysqld stop
:: Stopping MySQL Server                                                                          [DONE]


[root@my-desktop mypc]# mysqld_safe --skip-grant-tables &
[1] 23105
[root@my-desktop mypc]# 100809 15:27:06 mysqld_safe Logging to '/var/lib/mysql/my-desktop.err'.
100809 15:27:06 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
^C


[root@my-desktop mypc]# mysql -u root mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with; or \g.
Your MySQL connection id is 1
Server version: 5.1.47 Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.



mysql> UPDATE user SET password=PASSWORD("qwerty") WHERE User='root';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 0  Changed: 0  Warnings: 0



mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)



mysql> exit
Bye


[root@my-desktop mypc]# /etc/rc.d/mysqld restart
:: Stopping MySQL Server                                                                          [BUSY] 100809 15:27:32 mysqld_safe mysqld from pid file /var/lib/mysql/my-desktop.pid ended
                                                                                                  [DONE]
:: Starting MySQL Server                                                                          [DONE]
[1]+  Done                    mysqld_safe --skip-grant-tables


[root@my-desktop mypc]# mysql -u root mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)


[root@my-desktop mypc]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)


Спасибо сказали:
Аватара пользователя
sash-kan
Администратор
Сообщения: 13939
Статус: oel ngati kameie
ОС: GNU

Re: MySQL не зайти под рутом

Сообщение sash-kan »

Kirizel писал(а):
09.08.2010 15:53
mysql> UPDATE user SET password=PASSWORD("qwerty") WHERE User='root';
Query OK, 0 rows affected (0.00 sec)
нет такой записи.
если нужна — создайте:
create user 'root'@'localhost' identified by 'qwerty';
grant all on *.* to 'root'@'localhost' with grant option;
flush privileges;
Писать безграмотно - значит посягать на время людей, к которым мы адресуемся, а потому совершенно недопустимо в правильно организованном обществе. © Щерба Л. В., 1957
при сбоях форума см.блог
Спасибо сказали: