用户'debian-sys-maint'的访问被拒绝-安装mysql吗?


12

我试图安装mysql,但出现错误:

mysql_upgrade: Got error: 1045: Access denied for user 'debian-sys-maint'@'localhost' (using password: YES) while connecting to the MySQL server

经过一番搜索后,我发现这可能会给debian-sys-maint带来麻烦,所以我:

sudo cat /etc/mysql/debian.cnf

然后在mysql中设置debian密码:

mysql -u root -p <password>
GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'password-here';

然后我重新启动:

sudo /etc/init.d/mysql restart

并再次尝试配置:

sudo dpkg --configure -a

我犯了同样的错误。



Rinzwind,这个答案正是我已经尝试过的。
panthro

根目录的主目录中是否存在.my.cnf或/var/lib/mysql其中可能包含deb-sys-maint的用户数据?
菲利普-Zyan K Lee- Stockmann

根本没有root,尝试cd / var / lib / mysql时权限被拒绝
-panthro

Answers:


6

有点晚了,但是在这里:首先我在

Distributor ID: Ubuntu
Description:    Ubuntu 16.10
Release:    16.10
Codename:   yakkety

我不得不“取消选中”某些软件存储库。可以Software & UpdatesOther Software选项卡上的GUI上轻松完成。我未选中:

  • 不稳定的仓库
  • 塞纳回购
  • “在升级到yakkety时禁用”存储库

对我来说,唯一检查过的存储库是:

软件和更新窗口

然后,我以这种方式解决了这个问题:

sudo su

root@iqbal: mysql -u root -p
Enter password:
mysql> GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '<your password>';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

如果出现错误(1819),请在mysql终端上键入

mysql> uninstall plugin validate_password;

然后重启mysql: systemctl restart mysql

最后

apt install -f

修复损坏的依赖项

如果错误仍然存​​在,请再次输入mysql终端,登录:键入:

mysql> GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '<your password>'

apt -f install 最后一次。

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  libmecab2
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mysql-server-5.7 (5.7.17-0ubuntu0.16.10.1) ...
Checking if update is needed.
Checking server version.
Running queries to upgrade MySQL server.
Checking system database.
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.engine_cost                                  OK
mysql.event                                        OK
mysql.func                                         OK
mysql.general_log                                  OK
mysql.gtid_executed                                OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.innodb_index_stats                           OK
mysql.innodb_table_stats                           OK
mysql.ndb_binlog_index                             OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.proxies_priv                                 OK
mysql.server_cost                                  OK
mysql.servers                                      OK
mysql.slave_master_info                            OK
mysql.slave_relay_log_info                         OK
mysql.slave_worker_info                            OK
mysql.slow_log                                     OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.user                                         OK
The sys schema is already up to date (version 1.5.1).
Checking databases.

(your databases will be shown here...)

Upgrade process completed successfully.
Checking if update is needed.
Setting up mysql-server (5.7.17-0ubuntu0.16.10.1) ...

解决的另一种方法是: apt -u dist-upgrade


我不敢相信那行得通!:-D你怎么知道的?
堆栈下溢

这在Ubuntu 16.04上为我工作
Stack
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.