【问题标题】:I am trying to install MySql on Debian 10 and keep getting an error. What am I doing wrong?我正在尝试在 Debian 10 上安装 MySql 并不断收到错误消息。我究竟做错了什么?
【发布时间】:2019-09-08 23:16:43
【问题描述】:

我一直尝试在全新安装的 Debian 10 上安装 MySql 或 MariaDb。应该是一个简单的过程,(sudo apt-get install mariadb-server mariadb-client) 但我不断收到此错误:

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
mariadb-client : Depends: mariadb-client-10.4 (>= 
1:10.4.7+maria~buster) but it is not going to be installed
mariadb-server : Depends: mariadb-server-10.4 (>= 
1:10.4.7+maria~buster) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

这是全新安装。已安装 PHP 和 Apache2。我已经尝试过多次使用第一个 MySql,然后当它不起作用时,我尝试使用 MariaDb,但仍然得到相同的错误。不知道还能做什么。我尝试了谷歌搜索,唯一关闭的建议是确保它没有安装,甚至清除任何以前的安装。我试过了,还是不行。

【问题讨论】:

    标签: mysql debian


    【解决方案1】:

    在处理了大约 4 个小时之后,我终于弄明白了。在安装 Debian 时,我看到了一些关于要安装的软件的选项。其中一种选择是安装 Web 服务器软件。所以,我选择这样做。那是个错误。首先,您不会通过选择该选项获得所有需要的 php 模块。其次,该选择确实安装了 MySql 所需的一些内容,但不足以实际工作。 所以,最后,对于其他有这个问题的人,这就是我解决它的方法。 首先,运行命令:

        sudo service mysql stop
        sudo apt-get --purge remove "mysql*"
        sudo rm -rf /etc/mysql/ 
    

    然后,通过运行确保一切都消失了

       sudo updatedb
       locate mysql
    

    您仍会看到一些内容,但请确保您没有看到 my.cnf 文件。那是我的罪魁祸首。如果您确实看到它,请将其删除。 现在重新安装 MySql,你应该没有任何问题。如果您还安装了 phpMyAdmin,您仍然需要再运行一个命令来获取所需的扩展。

        sudo apt install php-imagick php-phpseclib php-php-gettext php7.3-common 
        php7.3-gd php7.3-imap php7.3-json php7.3-curl php7.3-zip php7.3-xml 
        php7.3-mbstring php7.3-bz2 php7.3-intl php7.3-gmp
    

    【讨论】:

      猜你喜欢
      • 2022-01-23
      • 1970-01-01
      • 1970-01-01
      • 2020-03-20
      • 1970-01-01
      • 2013-09-07
      • 2014-06-15
      • 1970-01-01
      • 2013-08-06
      相关资源
      最近更新 更多