我正在使用Focal Fossa,并且已经安装了mysql。我试图将其删除并安装mariadb。我尝试了sudo apt-get remove mysql,但是当我执行mysql -V时,我得到的是mysql Ver 8.0.20-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu))。然后我尝试了sudo apt-get purge mysql*,但是它显示没有找到匹配项。
我尝试了以下命令,但是得到相同的错误:
sudo apt-get remove mysql-server
当我尝试使用 "sudo dpkg -l | grep mysql" 命令时,结果是:
我尝试使用
当我尝试运行
如果有人能帮忙,将不胜感激。
我尝试了以下命令,但是得到相同的错误:
sudo apt-get remove mysql-server
Setting up mysql-server-8.0 (8.0.20-0ubuntu0.20.04.1) ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
/var/lib/dpkg/info/mysql-server-8.0.postinst: line 191: /usr/share/mysql-common /configure-symlinks: No such file or directory
dpkg: error processing package mysql-server-8.0 (--configure):
installed mysql-server-8.0 package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
mysql-server-8.0
E: Sub-process /usr/bin/dpkg returned an error code (1)
当我尝试使用 "sudo dpkg -l | grep mysql" 命令时,结果是:
pi mysql-client-8.0 8.0.20-0ubuntu0.20.04.1 amd64 MySQL database client binaries
ii mysql-client-core-8.0 8.0.20-0ubuntu0.20.04.1 amd64 MySQL database core client binaries
ii mysql-common 5.8+1.0.5ubuntu2 all MySQL database common files, e.g. /etc/mysql/my.cnf
pF mysql-server-8.0 8.0.20-0ubuntu0.20.04.1 amd64 MySQL database server binaries and system database setup
pi mysql-server-core-8.0 8.0.20-0ubuntu0.20.04.1 amd64 MySQL database server binaries
ii php7.3-mysql 7.3.18-1+ubuntu20.04.1+deb.sury.org+1 amd64 MySQL module for PHP
ii php7.4-mysql
我尝试使用
sudo apt-remove mysql*
来移除其中的每一个,但是出现了错误。Removing mysql-server-8.0 (8.0.20-0ubuntu0.20.04.1) ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: error processing package mysql-server-8.0 (--remove):
installed mysql-server-8.0 package pre-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
Failed to preset unit: File mysql.service: Link has been severed
/usr/bin/deb-systemd-helper: error: systemctl preset failed on mysql.service: No such file or directory
Failed to start mysql.service: Unit mysql.service not found.
invoke-rc.d: initscript mysql, action "start" failed.
Unit mysql.service could not be found.
dpkg: error while cleaning up:
installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
mysql-server-8.0
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
当我尝试运行
sudo apt-get -f install
时,出现了错误。Setting up mysql-server-8.0 (8.0.20-0ubuntu0.20.04.1) ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
/var/lib/dpkg/info/mysql-server-8.0.postinst: line 191: /usr/share/mysql-common/configure-symlinks: No such file or directory
dpkg: error processing package mysql-server-8.0 (--configure):
installed mysql-server-8.0 package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
mysql-server-8.0
E: Sub-process /usr/bin/dpkg returned an error code (1)
如果有人能帮忙,将不胜感激。
`
/usr/share/mysql-common/configure-symlinks install mysql "$mysql_cfgdir/mysql.cnf"
。 - Anoop D无法停止mysql.service:Unit mysql.service未加载。 invoke-rc.d: initscript mysql, action "stop" failed. dpkg: error processing package mysql-server-8.0 (--purge): installed mysql-server-8.0 package pre-removal script subprocess returned error exit status 1
- Anoop DFailed to stop mysql.service: Unit mysql.service not loaded. invoke-rc.d: initscript mysql, action "stop" failed. Failed to preset unit: File mysql.service: Link has been severed /usr/bin/deb-systemd-helper: error: systemctl preset failed on mysql.service: No such file or directory Failed to start mysql.service: Unit mysql.service not found. invoke-rc.d: initscript mysql, action "start" failed. Unit mysql.service could not be found. dpkg: error while cleaning up: installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
- Anoop Dmysql
时,我得到的是RROR 2002 (HY000): 无法通过套接字'/var/run/mysqld/mysqld.sock'连接到本地MySQL服务器(2)
。 - Anoop D