我一直按照此页面 上的说明在Ubuntu 16.04上安装mysql。
我在标题为“ MySQL Install and Configure”的页面的下半部分运行了命令sudo apt-get install mysql-server
。我遇到了一个错误,但这是我的终端中该错误的输出:
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 41515 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.7.12-0ubuntu1_all.deb ...
Unpacking mysql-common (5.7.12-0ubuntu1) ...
Selecting previously unselected package mysql-client-5.7.
Preparing to unpack .../mysql-client-5.7_5.7.12-0ubuntu1_amd64.deb ...
Unpacking mysql-client-5.7 (5.7.12-0ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up mysql-common (5.7.12-0ubuntu1) ...
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Selecting previously unselected package mysql-server-5.7.
(Reading database ... 41563 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.7_5.7.12-0ubuntu1_amd64.deb ...
Unpacking mysql-server-5.7 (5.7.12-0ubuntu1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.7.12-0ubuntu1_all.deb ...
Unpacking mysql-server (5.7.12-0ubuntu1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu4) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up mysql-client-5.7 (5.7.12-0ubuntu1) ...
Setting up mysql-server-5.7 (5.7.12-0ubuntu1) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
mysql_upgrade: Got error: 1045: Access denied for user 'debian-sys-maint'@'localhost' (using password: YES) while connecting to the MySQL server
Upgrade process encountered error and will not continue.
mysql_upgrade failed with exit status 11
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu4) ...
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
这是我第一次设置服务器并安装mysql。不知道这是否可能是错误的可能原因,但是我以前曾尝试安装mysql,但未遵循LAMP进程(我是newb弄清楚了这一点),但未成功,我必须卸载。
debian.cnf
文件了。我找到了这个stackoverflow.com/questions/11644300/…- 并查看得到47分(不是可接受的答案)的答案,密码不匹配。我正在试一试-不成功,因为我不知道密码是什么!
Access denied for user 'debian-sys-maint'@'localhost'
。该用户来自哪里?我不希望在Ubuntu系统上找到它。