Mysql

Ubuntu 從 14.04 LTS 升級到 16.04 失敗 - mysql-server-5.7 依賴失敗

  • August 11, 2016

我正在嘗試將現有升級Ubuntu 14.04 LTSUbuntu 16.04 LTS,似乎我被困在中間的某個地方。當我打開我的工作站時,我會看到Ubuntu 16.04 LTS歡迎和登錄螢幕,這沒關係,最新的核心已啟動並正在執行,但是,當我這樣做sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get autoremove然後按Y/y確認升級時,我得到:

user@work002:~$ sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get autoremove
Get:1 http://si.archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Hit:2 http://archive.canonical.com/ubuntu xenial InRelease                                                                                 
Hit:3 http://security.ubuntu.com/ubuntu xenial-security InRelease                                                                          
Hit:4 http://si.archive.ubuntu.com/ubuntu xenial-updates InRelease                                    
Hit:5 http://archive.canonical.com xenial InRelease                                                   
Hit:6 http://si.archive.ubuntu.com/ubuntu xenial-backports InRelease                                  
Fetched 247 kB in 0s (319 kB/s)                    
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
 account-plugin-twitter bluez-gstreamer bsh calculix-ccx checkbox-ng comerr-dev dh-apparmor firefox-locale-he firefox-locale-ru firefox-locale-sl fonts-unfonts-core friends friends-dispatcher
 friends-facebook friends-twitter g++-4.8 gcc-4.9-base:i386 gcj-4.8-jre-lib gir1.2-ebook-1.2 gir1.2-ebookcontacts-1.2 gir1.2-edataserver-1.2 gir1.2-gnomebluetooth-1.0 gir1.2-messagingmenu-1.0
 gir1.2-networkmanager-1.0 gstreamer0.10-pulseaudio gstreamer1.0-clutter gtk3-engines-unico heirloom-mailx icedtea-netx icedtea-netx-common iproute jetty jsvc ko.tex-extra-hlfont krb5-multidev
 kubuntu-debug-installer latex-sanskrit libass4 libatk-wrapper-java libatk-wrapper-java-jni libavcodec54 libavformat54 libavutil52 libbaloocore4 libbaloofiles4 libbalooxapian4 libbasicusageenvironment0
 libbetter-appframework-java libbind9-90 libboost-date-time1.54.0 libboost-program-options1.55.0 libboost-python1.55.0 libboost-regex1.55.0 libboost-signals1.55.0 libboost-system1.54.0
 libboost-system1.55.0 libcamel-1.2-45 libcdr-0.0-0 libcglib-java libclutter-gst-2.0-0 libcmis-0.4-4 libcolord1 libcolorhug1 libcommons-daemon-java libcr0 libcrypt-passwdmd5-perl libcxsparse3.1.2
 libdb-java libdb-je-java libdb5.3-java libdb5.3-java-jni libdbd-mysql-perl libdbi-perl libdbus-1-3:i386 libdirac-encoder0 libdns100 libdrm2:i386 libdvbpsi8 libeasymock-java libebackend-1.2-7
 libebook-1.2-14 libebook-contacts-1.2-0 libedata-book-1.2-20 libedataserver-1.2-18 libegl1-mesa-lts-vivid libelfg0 libenca0 libepub0 libetpan15 libexiv2-12 libflute-java libfriends0 libgbm1-lts-vivid
 libgcj-bc libgcj14 libgconf2-4 libgdata13 libgee2 libgeos-3.4.2 libgif4 libgl1-mesa-dri-lts-vivid libgl1-mesa-glx-lts-vivid libglapi-mesa-lts-vivid libgles1-mesa-lts-vivid libgles2-mesa-lts-vivid
 libglew1.10 libglewmx1.10 libgnome-bluetooth11 libgnome-desktop-3-7 libgnutls-dev libgnutlsxx27 libgphoto2-port10 libgraphicsmagick++3 libgraphicsmagick3 libgrip0 libgroupsock1 libgtksourceview2.0-0
 libgtksourceview2.0-common libgtop2-7 libhdf5-7 libicc2 libicu52 libidl-common libimdi0 libimobiledevice4 libintl-perl libisc95 libisccc90 libisccfg90 libisl10 libjavascriptcoregtk-1.0-0 libjetty-java
 libjline-java libjs-codemirror libjs-jquery-cookie libjs-jquery-event-drag libjs-jquery-metadata libjs-jquery-mousewheel libjs-jquery-tablesorter libjs-jquery-ui libjson-c2:i386 libjtidy-java
 libkactivities-models1 libkadm5clnt-mit9 libkadm5srv-mit9 libkidletime4 libkrb5-dev liblcms1 liblinear1 liblivemedia23 liblouis2 liblucene2-java liblwres90 libmagick++5 libmagickcore5
 libmagickcore5-extra libmagickwand5 libmbim-glib0 libminiupnpc8 libmspub-0.0-0 libmysqlclient18 libnb-platform13-java libnepomukcleaner4 libnepomukcore4abi1 libnetcdfc7 libnetx-java libnih-dbus1:i386
 libnih1:i386 libobjc-4.8-dev liboctave2 libopenjpeg2 liborbit2 liborcus-0.6-0 libp11-kit-dev libpanel-applet-4-0 libparted0debian1 libplist1 libpng12-0:i386 libpocketsphinx1 libpoppler-qt4-4 libpoppler44
 libpostproc52 libprotobuf8 libqhull6 libqjson0 libqmi-glib0 libqmobipocket1 libqpdf13 libqscintilla2-11 libqt5qml-graphicaleffects libqt5sensors5 libqt5webkit5-qmlwebkitplugin libraw9 librpmsign1
 librtaudio4 librtmidi1 librtmp0 libsac-java libsac-java-gcj libsctp1 libsexy2 libsoprano4 libsoqt4-20 libsphinxbase1 libspnav0 libspooles2.2 libstdc++-4.8-dev libstk0c2a libswingx1-java libswscale2
 libsystemd-daemon0 libsystemd-journal0 libsystemd-login0 libt1-5 libtar0 libtasn1-6-dev libterm-readkey-perl libthumbnailer0 libtorque2 libts-0.0-0 libunityvoice1 libupower-glib1 libusageenvironment1
 libusbmuxd2 libvirtodbc0 libvisio-0.0-0 libwebkitgtk-1.0-0 libwebkitgtk-1.0-common libwireshark3 libwiretap3 libwnck-common libwnck22 libwpd-0.9-9 libwpg-0.2-2 libwps-0.2-2 libwsutil3 libwxgtk-media2.8-0
 libx264-142 libxatracker2-lts-vivid libxcb-util0 libxtables10 libzip2 libzipios++0c2a linux-headers-generic-lts-vivid linux-image-generic-lts-vivid lksctp-tools nepomuk-core-data obex-data-server
 openjdk-7-doc perlmagick phonon-backend-gstreamer1.0 php5-gd php5-mysql php5-pgsql python-collada python-commandnotfound python-dateutil python-dbus-dev python-gconf python-gdbm python-gnome2
 python-gnomekeyring python-gobject python-gtksourceview2 python-ibus python-imaging-tk python-libxml2 python-matplotlib python-matplotlib-data python-notify python-pivy python-pyorbit python-pyparsing
 python-qt4-gl python-requests python-smbc python-support python-wxgtk2.8 python3-checkbox-ng qapt-batch qtdeclarative5-dialogs-plugin qtdeclarative5-localstorage-plugin
 qtdeclarative5-privatewidgets-plugin qtdeclarative5-qtfeedback-plugin qtdeclarative5-ubuntu-ui-extras-browser-plugin qtdeclarative5-ubuntu-ui-extras-browser-plugin-assets qtdeclarative5-window-plugin
 shared-desktop-ontologies signon-keyring-extension soprano-daemon sphinx-voxforge-hmm-en sphinx-voxforge-lm-en swath syslinux-themes-debian syslinux-themes-debian-wheezy telepathy-indicator tsconf
 ttf-dejavu-core ttf-dejavu-extra ubuntu-extras-keyring unity-lens-friends unity-scope-audacious unity-scope-clementine unity-scope-gmusicbrowser unity-scope-gourmet unity-scope-guayadeque
 unity-scope-musique unity-voice-service unixodbc virtuoso-minimal virtuoso-opensource-6.1-bin virtuoso-opensource-6.1-common xchat-common xfonts-mathml xserver-xorg-input-evdev-lts-vivid
 xserver-xorg-input-mouse-lts-vivid xserver-xorg-input-synaptics-lts-vivid xserver-xorg-input-vmmouse-lts-vivid xserver-xorg-input-wacom-lts-vivid xserver-xorg-video-ati-lts-vivid
 xserver-xorg-video-cirrus-lts-vivid xserver-xorg-video-fbdev-lts-vivid xserver-xorg-video-intel-lts-vivid xserver-xorg-video-mach64-lts-vivid xserver-xorg-video-mga-lts-vivid
 xserver-xorg-video-neomagic-lts-vivid xserver-xorg-video-nouveau-lts-vivid xserver-xorg-video-openchrome-lts-vivid xserver-xorg-video-r128-lts-vivid xserver-xorg-video-radeon-lts-vivid
 xserver-xorg-video-savage-lts-vivid xserver-xorg-video-siliconmotion-lts-vivid xserver-xorg-video-sisusb-lts-vivid xserver-xorg-video-tdfx-lts-vivid xserver-xorg-video-trident-lts-vivid
 xserver-xorg-video-vesa-lts-vivid xserver-xorg-video-vmware-lts-vivid
Use 'sudo apt autoremove' to remove them.
The following packages have been kept back:
 libjpeg-turbo-progs
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up mysql-server-5.7 (5.7.11-0ubuntu6) ...
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.
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                         dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script 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
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

當我檢查錯誤時systemctl status mysql.service,我得到:

user@work002:~$ systemctl status mysql.service
● mysql.service - MySQL Community Server
  Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
  Active: activating (start-post) (Result: exit-code) since pet 2016-04-22 19:38:49 CEST; 12s ago
 Process: 10171 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
 Process: 10168 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 10171 (code=exited, status=1/FAILURE);         : 10172 (mysql-systemd-s)
   Tasks: 2 (limit: 512)
  CGroup: /system.slice/mysql.service
          └─control
            ├─10172 /bin/bash /usr/share/mysql/mysql-systemd-start post
            └─10239 sleep 1

apr 22 19:38:49 work002 systemd[1]: Starting MySQL Community Server...
apr 22 19:38:51 work002 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE

journalctl -xe我得到:

user@work002:~$ journalctl -xe
apr 22 19:41:27 work002 systemd[1]: Stopped MySQL Community Server.
-- Subject: Unit mysql.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysql.service has finished shutting down.
apr 22 19:41:27 work002 systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysql.service has begun starting up.
apr 22 19:41:29 work002 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
apr 22 19:41:57 work002 systemd[1]: Failed to start MySQL Community Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysql.service has failed.
-- 
-- The result is failed.
apr 22 19:41:57 work002 systemd[1]: mysql.service: Unit entered failed state.
apr 22 19:41:57 work002 systemd[1]: mysql.service: Failed with result 'exit-code'.
apr 22 19:41:57 work002 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
apr 22 19:41:57 work002 systemd[1]: Stopped MySQL Community Server.
-- Subject: Unit mysql.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysql.service has finished shutting down.
apr 22 19:41:57 work002 systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysql.service has begun starting up.
apr 22 19:41:59 work002 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
apr 22 19:42:27 work002 systemd[1]: Failed to start MySQL Community Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysql.service has failed.
-- 
-- The result is failed.
apr 22 19:42:27 work002 systemd[1]: mysql.service: Unit entered failed state.
apr 22 19:42:27 work002 systemd[1]: mysql.service: Failed with result 'exit-code'.
apr 22 19:42:28 work002 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
apr 22 19:42:28 work002 systemd[1]: Stopped MySQL Community Server.
-- Subject: Unit mysql.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysql.service has finished shutting down.
apr 22 19:42:28 work002 systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysql.service has begun starting up.
apr 22 19:42:30 work002 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE

/var/lib/mysql由於我無法連接到mysql伺服器並導出SQL腳本,因此我通過複製文件進行了離線數據庫備份。如何克服此問題以完成升級Ubuntu 16.04 LTS

我還添加了以下輸出tail -n60 /var/log/mysql/error.log

2016-04-22T21:45:57.355858Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2016-04-22T21:45:57.355908Z 0 [Note] Plugin 'FEDERATED' is disabled.
2016-04-22T21:45:57.356069Z 0 [Note] InnoDB: Buffer pool(s) load completed at 160422 23:45:57
2016-04-22T21:45:57.356321Z 0 [Warning] System table 'plugin' is expected to be transactional.
2016-04-22T21:45:57.356485Z 0 [ERROR] unknown variable 'key_buffer=16M'
2016-04-22T21:45:57.356498Z 0 [ERROR] Aborting

2016-04-22T21:45:57.356507Z 0 [Note] Binlog end
2016-04-22T21:45:57.356551Z 0 [Note] Shutting down plugin 'ngram'
2016-04-22T21:45:57.356560Z 0 [Note] Shutting down plugin 'ARCHIVE'
2016-04-22T21:45:57.356565Z 0 [Note] Shutting down plugin 'partition'
2016-04-22T21:45:57.356570Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2016-04-22T21:45:57.356576Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2016-04-22T21:45:57.356581Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2016-04-22T21:45:57.356586Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2016-04-22T21:45:57.356591Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2016-04-22T21:45:57.356595Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2016-04-22T21:45:57.356600Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2016-04-22T21:45:57.356605Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2016-04-22T21:45:57.356610Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2016-04-22T21:45:57.356615Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2016-04-22T21:45:57.356620Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2016-04-22T21:45:57.356624Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2016-04-22T21:45:57.356629Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2016-04-22T21:45:57.356634Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2016-04-22T21:45:57.356639Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2016-04-22T21:45:57.356644Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2016-04-22T21:45:57.356649Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2016-04-22T21:45:57.356687Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2016-04-22T21:45:57.356695Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2016-04-22T21:45:57.356700Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2016-04-22T21:45:57.356705Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2016-04-22T21:45:57.356710Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2016-04-22T21:45:57.356715Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2016-04-22T21:45:57.356719Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2016-04-22T21:45:57.356724Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2016-04-22T21:45:57.356729Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2016-04-22T21:45:57.356734Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2016-04-22T21:45:57.356739Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2016-04-22T21:45:57.356743Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2016-04-22T21:45:57.356748Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2016-04-22T21:45:57.356753Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2016-04-22T21:45:57.356757Z 0 [Note] Shutting down plugin 'InnoDB'
2016-04-22T21:45:57.356886Z 0 [Note] InnoDB: FTS optimize thread exiting.
2016-04-22T21:45:57.357160Z 0 [Note] InnoDB: Starting shutdown...
2016-04-22T21:45:57.457470Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2016-04-22T21:45:57.457683Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 160422 23:45:57
2016-04-22T21:45:58.975431Z 0 [Note] InnoDB: Shutdown completed; log sequence number 17597621
2016-04-22T21:45:58.978042Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2016-04-22T21:45:58.978060Z 0 [Note] Shutting down plugin 'MEMORY'
2016-04-22T21:45:58.978068Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2016-04-22T21:45:58.978124Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2016-04-22T21:45:58.978130Z 0 [Note] Shutting down plugin 'MyISAM'
2016-04-22T21:45:58.978137Z 0 [Note] Shutting down plugin 'CSV'
2016-04-22T21:45:58.978143Z 0 [Note] Shutting down plugin 'sha256_password'
2016-04-22T21:45:58.978148Z 0 [Note] Shutting down plugin 'mysql_native_password'
2016-04-22T21:45:58.978153Z 0 [Note] Shutting down plugin 'keyring_file'
2016-04-22T21:45:58.978369Z 0 [Note] Shutting down plugin 'binlog'
2016-04-22T21:45:58.978540Z 0 [Note] /usr/sbin/mysqld: Shutdown complete

我還添加了dpkg -l|grep mysql輸出:

ii  dbconfig-mysql                                        2.0.4ubuntu1                                        all          dbconfig-common MySQL/MariaDB support
ii  libdbd-mysql-perl                                     4.033-1build2                                       amd64        Perl5 database interface to the MySQL database
ii  libmysql-java                                         5.1.38-1                                            all          Java database (JDBC) driver for MySQL
ii  libmysqlclient-dev                                    5.7.11-0ubuntu6                                     amd64        MySQL database development files
ii  libmysqlclient18:amd64                                5.5.49-0ubuntu0.14.04.1                             amd64        MySQL database client library
ii  libmysqlclient20:amd64                                5.7.11-0ubuntu6                                     amd64        MySQL database client library
rc  libmysqlcppconn7                                      1.1.3-5                                             amd64        MySQL Connector for C++ (library)
ii  libmysqlcppconn7v5                                    1.1.7-0ubuntu1                                      amd64        MySQL Connector for C++ (library)
ii  mysql-client-5.7                                      5.7.11-0ubuntu6                                     amd64        MySQL database client binaries
ii  mysql-client-core-5.7                                 5.7.11-0ubuntu6                                     amd64        MySQL database core client binaries
ii  mysql-common                                          5.7.11-0ubuntu6                                     all          MySQL database common files, e.g. /etc/mysql/my.cnf
iU  mysql-server                                          5.7.11-0ubuntu6                                     all          MySQL database server (metapackage depending on the latest version)
rc  mysql-server-5.5                                      5.5.49-0ubuntu0.14.04.1                             amd64        MySQL database server binaries and system database setup
hF  mysql-server-5.7                                      5.7.11-0ubuntu6                                     amd64        MySQL database server binaries and system database setup
ii  mysql-server-core-5.7                                 5.7.11-0ubuntu6                                     amd64        MySQL database server binaries
ii  mysql-utilities                                       1.6.1-2                                             all          collection of scripts for managing MySQL servers
ii  mysql-workbench                                       6.3.6+dfsg-0ubuntu1                                 amd64        MySQL Workbench - a visual database modeling, administration and queuing tool
rc  mysql-workbench-community                             6.3.6-1ubu1404                                      amd64        MySQL Workbench
ii  mysql-workbench-data                                  6.3.6+dfsg-0ubuntu1                                 all          MySQL Workbench -- architecture independent data
ii  php-mysql                                             1:7.0+35ubuntu6                                     all          MySQL module for PHP [default]
ii  php5-mysql                                            5.5.9+dfsg-1ubuntu4.16                              amd64        MySQL module for php5
rc  php5-mysqlnd                                          5.5.9+dfsg-1ubuntu4.14                              amd64        MySQL module for php5 (Native Driver)
ii  php7.0-mysql                                          7.0.4-7ubuntu2                                      amd64        MySQL module for PHP
ii  python-mysql.connector                                2.0.4-1                                             all          pure Python implementation of MySQL Client/Server protocol

您是否檢查過:https : //bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1571865(連結自 XenialXerus 發行說明https://wiki.ubuntu.com/XenialXerus/ReleaseNotes#MySQL_5 .7 )?

它解釋了由於某些配置指令的名稱更改,啟動mysql失敗。它還提到了三個解決方案,第一個解決了我的問題。

經過一番爭論,最終為我解決這個問題的事情就是創建一個失去的/etc/mysql/conf.d/目錄(即。sudo mkdir /etc/mysql/conf.d/)。有一個/etc/mysql/mysql.conf.d/目錄,但 MySQL 似乎conf.d也在尋找一個目錄,它的缺失似乎阻止了它的啟動。一旦我創建了目錄sudo service mysql start就可以了,一切都很好。

如果它有用,執行命令journalctl -xe並仔細查看它輸出的日誌是我發現“缺少目錄”錯誤的方式。

引用自:https://serverfault.com/questions/772302