apt-get moodle 错误 1045

apt-get moodle 错误 1045

当我在 Ubuntu 中尝试安装与 Moodle 不相关的程序时,我收到一条有关 Moodle 处理错误的错误消息:

# apt-get install screen

Reading package lists... Done
Building dependency tree       
Reading state information... Done
screen is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 162 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up moodle (1.9.9.dfsg2-3) ...
dbconfig-common: writing config to /etc/dbconfig-common/moodle.conf
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO).
unable to connect to mysql server.
error encountered creating user:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
dpkg: error processing moodle (--configure):
subprocess installed post-installation script returned error exit status 10
No apport report written because MaxReports is reached already

Errors were encountered while processing:
  moodle

E: Sub-process /usr/bin/dpkg returned an error code (1)

为什么会发生这种情况,以及如何安装软件而不出现此错误/引用 Moodle?

我尝试使用apt-get删除 Moodle

root@bnserver:/var/crash# sudo apt-get remove moodle
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  moodle
0 upgraded, 0 newly installed, 1 to remove and 162 not upgraded.
1 not fully installed or removed.
After this operation, 53.8 MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 184717 files and directories currently installed.)
Removing moodle ...
dpkg: error processing moodle (--remove):
 subprocess installed pre-removal script returned error exit status 10
No apport report written because MaxReports is reached already
                                                              dbconfig-common:     flushing administrative password
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 10
Errors were encountered while processing:
 moodle
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

发生这种情况是因为 Moodle 尝试连接的 MySQL 数据库无法将 root 识别为授权用户。您可能需要正确设置 MySQL 才能继续。

相关内容