数据库
首页 > 数据库> > 16.04 – 用户’debian-sys-maint’拒绝访问 – 安装mysql?

16.04 – 用户’debian-sys-maint’拒绝访问 – 安装mysql?

作者:互联网

我试图安装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

我犯了同样的错误.

解决方法:

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

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

我不得不“取消选中”一些软件存储库.它可以很容易地在Software&更新“其他软件”选项卡上的GUI.我取消选中:

>不稳定的回购
> xenial回购
>“升级到yakkety时禁用”存储库

我唯一检查的存储库是:

software&updates window

然后,我这样解决了问题:

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终端上键入this

mysql> uninstall plugin validate_password;

然后重启mysql:systemctl重启mysql

最后

apt install -f

修复破坏的依赖项

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

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

apt -f最后一次安装.

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

标签:mysql,16-04
来源: https://codeday.me/bug/20190808/1621142.html