【问题标题】:Trouble install MySQL 8 to Debian 10无法将 MySQL 8 安装到 Debian 10
【发布时间】:2021-04-13 05:12:03
【问题描述】:

我尝试将 MySQL 0.8.16-1 安装到 Debian 10 系统。 我遵循了这个描述:

https://serverspace.io/support/help/how-to-install-mysql-on-debian-10/ 这些是我运行的命令:

sudo apt update

sudo apt install gnupg

cd /tmp

wget https://dev.mysql.com/get/mysql-apt-config_0.8.16-1_all.deb

sudo apt-get update

sudo apt-get install mysql-community-server

在安装结束时,我总是在日志中得到以下信息:

emitting matrix      : 100% |###########################################|  
done!
    update-alternatives: using /var/lib/mecab/dic/ipadic-utf8 to provide /var/lib/mecab/dic/debian (mecab-dictionary) in auto mode
    Setting up mysql-community-client (8.0.22-1debian10) ...
    Setting up mysql-client (8.0.22-1debian10) ...
    Setting up mysql-community-server (8.0.22-1debian10) ...
    update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
    my_print_defaults: Can't read dir of '/etc/mysql/conf.d/' (OS errno 2 - No such file or directory)
    my_print_defaults: [ERROR] Fatal error in defaults handling. Program aborted!
    my_print_defaults: Can't read dir of '/etc/mysql/conf.d/' (OS errno 2 - No such file or directory)
    my_print_defaults: [ERROR] Fatal error in defaults handling. Program aborted!
    my_print_defaults: Can't read dir of '/etc/mysql/conf.d/' (OS errno 2 - No such file or directory)
    my_print_defaults: [ERROR] Fatal error in defaults handling. Program aborted!
    my_print_defaults: Can't read dir of '/etc/mysql/conf.d/' (OS errno 2 - No such file or directory)
    my_print_defaults: [ERROR] Fatal error in defaults handling. Program aborted!
    mysqld: Can't read dir of '/etc/mysql/conf.d/' (OS errno 2 - No such file or directory)
    mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
    dpkg: error processing package mysql-community-server (--configure):
     installed mysql-community-server package post-installation script subprocess returned error exit status 1
    Processing triggers for man-db (2.8.5-2) ...
    Processing triggers for libc-bin (2.28-10) ...
    Errors were encountered while processing:
     mysql-community-server
    E: Sub-process /usr/bin/dpkg returned an error code (1)

我已经尝试完全删除 MySQL 并重新安装。清除后,自动删除和自动清理运行:

sudo apt-get dist-upgrade

然后再次运行安装,但没有帮助。

我检查了目录 /etc/mysql 但对我来说似乎没问题:

drwxr-xr-x  3 root root 4096 Jan  7 07:46 .
drwxr-xr-x 73 root root 4096 Jan  7 07:46 ..
lrwxrwxrwx  1 root root   24 Jan  7 07:46 my.cnf -> /etc/alternatives/my.cnf
-rw-r--r--  1 root root 1497 Sep 23 09:40 mysql.cnf
drwxr-xr-x  2 root root 4096 Jan  7 07:46 mysql.conf.d

有什么建议会导致这个问题吗?

【问题讨论】:

  • 尝试sudo apt-get purge mysql-community-server,然后手动删除整个mysql文件夹sudo rm -rf /etc/mysql,然后重新安装sudo apt-get install -y mysql-community-server
  • 感谢您的回答@Frank。不幸的是,它没有帮助。我做了你写的,遇到了同样的问题:Setting up mysql-community-server (8.0.22-1debian10) ... update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode my_print_defaults: Can't read dir of '/etc/mysql/conf.d/' (OS errno 2 - No such file or directory)我检查了创建的mysql文件夹,文件:lrwxrwxrwx 1 root root 24 Jan 11 02:36 my.cnf -> /etc/alternatives/my.cnf-rw-r--r-- 1 root root 1497 Sep 23 09:40 mysql.cnf

标签: mysql linux debian


【解决方案1】:

问题在于 VPS 服务器只有 0.5 GB 的 RAM。 对于 MySQL 8.0.. 建议至少 4 GB! 我知道这是一个愚蠢的错误,但也许有人可以从中吸取教训。

【讨论】:

    猜你喜欢
    • 2019-06-23
    • 2021-09-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-22
    • 1970-01-01
    • 1970-01-01
    • 2016-05-01
    相关资源
    最近更新 更多