Обновление MySQL с 5.7 до 8 на Ubuntu 18.04 (Bionic)

Как сказано в названии. Я попытался перейти на MySQL 8 на своем компьютере с Ubuntu 18.04. Я загрузил mysql-apt-config_0.8.12-1.all.deb , обновил, а затем попытался обновить. Вот результат работы моего терминала:

faiz@faiz ~ > sudo dpkg -i mysql-apt-config_0.8.12-1_all.deb 
dpkg: error: dpkg frontend is locked by another process
faiz@faiz ~ > sudo dpkg -i mysql-apt-config_0.8.12-1_all.deb 
Selecting previously unselected package mysql-apt-config.
(Reading database ... 609461 files and directories currently installed.)
Preparing to unpack mysql-apt-config_0.8.12-1_all.deb ...
Unpacking mysql-apt-config (0.8.12-1) ...
Setting up mysql-apt-config (0.8.12-1) ...
Warning: apt-key should not be used in scripts (called from postinst maintainerscript of the package mysql-apt-config)
OK
faiz@faiz ~ > sudo apt update
Ign:1 http://packages.linuxmint.com tara InRelease
Hit:2 http://packages.linuxmint.com tara Release                                                                                     
Ign:3 https://storage.googleapis.com/download.dartlang.org/linux/debian stable InRelease                                                                                      
Hit:5 http://repo.mysql.com/apt/ubuntu bionic InRelease                                                                                                                       
Hit:6 http://archive.canonical.com/ubuntu bionic InRelease                                                                                                                    
Get:7 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]                                                                                                   
Hit:8 http://packages.microsoft.com/repos/code stable InRelease                                                                                                               
Hit:9 https://storage.googleapis.com/download.dartlang.org/linux/debian stable Release                                                                                        
Hit:10 http://mirror.cogentco.com/pub/linux/ubuntu bionic InRelease                                                                                                           
Hit:11 https://download.mono-project.com/repo/ubuntu vs-bionic InRelease                                                                                                      
Ign:12 http://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 InRelease                                                                                                    
Ign:13 http://repo.vivaldi.com/stable/deb stable InRelease                                                                                                                    
Hit:14 http://repo.vivaldi.com/stable/deb stable Release                                                                                                                      
Hit:15 http://mirror.cogentco.com/pub/linux/ubuntu bionic-updates InRelease                                                                                                   
Hit:16 https://deb.opera.com/opera-stable stable InRelease                                                                                                                    
Hit:17 https://deb.nodesource.com/node_12.x bionic InRelease                                                                                                                  
Hit:18 http://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 Release                                                                                                     
Hit:19 http://mirror.cogentco.com/pub/linux/ubuntu bionic-backports InRelease                                                                          
Hit:20 http://ppa.launchpad.net/linuxuprising/java/ubuntu bionic InRelease                                                       
Hit:21 http://apt.postgresql.org/pub/repos/apt bionic-pgdg InRelease                                                                  
Hit:23 http://ppa.launchpad.net/malteworld/ppa/ubuntu bionic InRelease                                                                
Hit:25 http://ppa.launchpad.net/noobslab/macbuntu/ubuntu bionic InRelease      
Hit:26 http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu bionic InRelease 
Fetched 88.7 kB in 2s (45.9 kB/s)                   
Reading package lists... Done
Building dependency tree       
Reading state information... Done
5 packages can be upgraded. Run 'apt list --upgradable' to see them.
faiz@faiz ~ > sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  mysql-client mysql-common mysql-server mysql-testsuite
The following packages will be upgraded:
  mysql-apt-config
1 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
4 not fully installed or removed.
Need to get 35.5 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://repo.mysql.com/apt/ubuntu bionic/mysql-apt-config amd64 mysql-apt-config all 0.8.16-1 [35.5 kB]
Fetched 35.5 kB in 0s (129 kB/s)            
Preconfiguring packages ...
(Reading database ... 609466 files and directories currently installed.)
Preparing to unpack .../mysql-apt-config_0.8.16-1_all.deb ...
Unpacking mysql-apt-config (0.8.16-1) over (0.8.12-1) ...
Setting up mysql-apt-config (0.8.16-1) ...
Warning: apt-key should not be used in scripts (called from postinst maintainerscript of the package mysql-apt-config)
OK
Setting up mysql-server-5.7 (5.7.35-0ubuntu0.18.04.1) ...
Renaming removed key_buffer and myisam-recover options (if present)
Unable to determine if daemon is running: No such file or directory
Warning: Unable to start the server. Please restart MySQL and run mysql_upgrade to ensure the database is ready for use.
Unable to determine if daemon is running: No such file or directory
Warning: Unable to start the server.
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Tue 2021-08-17 11:45:50 CDT; 6ms ago
  Process: 12521 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid (code=exited, status=1/FAILURE)
  Process: 12512 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 28432 (code=exited, status=1/FAILURE)
dpkg: error processing package mysql-server-5.7 (--configure):
 installed mysql-server-5.7 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.7; however:
  Package mysql-server-5.7 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
No apport report was written because the error message indicates its a followup error from a previous failure.
                                                                                                          dpkg: dependency problems prevent configuration of mysql-testsuite-5.7:
 mysql-testsuite-5.7 depends on mysql-server-5.7 (= 5.7.35-0ubuntu0.18.04.1); however:
  Package mysql-server-5.7 is not configured yet.

dpkg: error processing package mysql-testsuite-5.7 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of mysql-testsuite:
 mysql-testsuite depends on mysql-testsuite-5.7; however:
  Package mysql-testsuite-5.7 is not configured yet.

dpkg: error processing package mysql-testsuite (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          No apport report written because MaxReports is reached already
                                                                                                                                                                        Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
 mysql-testsuite-5.7
 mysql-testsuite
E: Sub-process /usr/bin/dpkg returned an error code (1)
faiz@faiz ~ > sudo apt upgrade

Я много раз пытался найти решение этой проблемы, но ни один из них не увенчался успехом.

0
задан 17 August 2021 в 20:12

1 ответ

Я столкнулся с аналогичной проблемой, когда обновлял Ubuntu с 18.04 до 20.04. Что решило для меня, так это полностью удалить MySQL, выполнив следующую команду

Убедитесь, что у вас есть резервная копия ваших баз данных и конфигурационный файл

sudo apt-get purge mysql\* libmysql\*

Затем я пошел, убедившись, что в нем не осталось следов mysql или его конфигураций:

  • /var/lib/mysql
  • /etc/mysql

Затем я переустановил и загрузил свои резервные базы данных.

0
ответ дан 20 August 2021 в 10:25

Другие вопросы по тегам:

Похожие вопросы: