删除maria db后无法安装mysql ubuntu

uqdfh47h  于 2021-06-20  发布在  Mysql
关注(0)|答案(1)|浏览(470)

我当时在使用mysql数据库,不幸的是我安装了mariadb,当我想返回mysql时,出现了一个错误,我删除了mariadb并尝试用这个命令安装mysql

  1. sudo apt-get install mysql-server

但我有个错误

  1. Reading package lists... Done
  2. Building dependency tree
  3. Reading state information... Done
  4. mysql-server is already the newest version (5.7.22-0ubuntu0.16.04.1).
  5. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  6. 2 not fully installed or removed.
  7. After this operation, 0 B of additional disk space will be used.
  8. Do you want to continue? [Y/n] y
  9. Setting up mysql-server-5.7 (5.7.22-0ubuntu0.16.04.1) ...
  10. update-alternatives: error: alternative path /etc/mysql/mysql.cnf doesn't
  11. exist
  12. dpkg: error processing package mysql-server-5.7 (--configure):
  13. subprocess installed post-installation script returned error exit status 2
  14. dpkg: dependency problems prevent configuration of mysql-server:
  15. mysql-server depends on mysql-server-5.7; however:
  16. Package mysql-server-5.7 is not configured yet.
  17. dpkg: error processing package mysql-server (--configure):
  18. dependency problems - leaving unconfigured
  19. No apport report written because the error message indicates its a
  20. followup error from a previous failure.
  21. Errors were encountered while processing:
  22. mysql-server-5.7
  23. mysql-server
  24. E: Sub-process /usr/bin/dpkg returned an error code (1)

我不能重新安装mysql,我能做什么,我寻找解决方案,但没有结果

8ljdwjyq

8ljdwjyq1#

尝试清除,然后重新安装。

  1. sudo apt-get remove --purge mysql-\*
  2. sudo apt-get install mysql-server mysql-client

相关问题