Сегодня я хотел создать базу данных в PMA. Он сказал: «Невозможно войти на сервер MySQL». Я пытался через терминал, та же проблема, и это потому, что мой пароль неверный. И я не могу понять почему.
Я попытался обычным способом сбросить пароль root (пропустить монтирование таблиц грантов и сбросить пароль), но, похоже, он не работает.
Видеть, что:
morgan@rakija:~$ sudo mysqld_safe --skip-grant-tables & [1] 14016 morgan@rakija:~$ 150802 19:07:25 mysqld_safe Can't log to error log and syslog at the same time. Remove all --log-error configuration options for --syslog to take effect. 150802 19:07:25 mysqld_safe Logging to '/var/log/mysql/error.log'. 150802 19:07:25 mysqld_safe A mysqld process already exists [1]+ Terminé 1 sudo mysqld_safe --skip-grant-tables morgan@rakija:~$ mysql -u root Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 2 Server version: 10.0.20-MariaDB-0ubuntu0.15.04.1 (Ubuntu) Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> use mysql; Database changed MariaDB [mysql]> update user set password=PASSWORD("newPass") where user='root'; Query OK, 4 rows affected (0.00 sec) Rows matched: 4 Changed: 4 Warnings: 0 MariaDB [mysql]> flush privileges; Query OK, 0 rows affected (0.00 sec) MariaDB [mysql]> exit Bye morgan@rakija:~$ sudo service mysql restart morgan@rakija:~$ mysql -uroot -pnewPass ERROR 1698 (28000): Access denied for user 'root'@'localhost'
Это нарушает работу cron по обслуживанию в Ubuntu 16.04 (по крайней мере), потому что этот сценарий ожидает входа в систему без пароля с помощью плагина сокета. См. Https://superuser.com/questions/957708/mysql-mariadb-error-1698-28000-access-denied-for-user-rootlocalhost/1103735 для получения подробной информации.