简体   繁体   English

Ubuntu 16.04上的MySQL 5.7升级错误

[英]MySQL 5.7 Upgrade error on Ubuntu 16.04

I was just uninstalling nginx and then in that apt-get remove command, I see that mysql-server is updating. 我只是卸载nginx,然后在apt-get remove命令中看到mysql-server正在更新。 Then the update hung up. 然后更新挂断了。 I killed the "apt-get" process (followed some answer somewhere). 我杀死了“ apt-get”过程(在某处跟随了一些答案)。 Then things kept on happening and the mysql was completely screwed up. 然后事情不断发生,MySQL完全被搞砸了。 I followed @jargonjunkie 's answer here: https://askubuntu.com/questions/763534/cannot-reinstall-mysql-server-after-its-purge also but to no avail. 我在这里遵循@jargonjunkie的回答: https ://askubuntu.com/questions/763534/cannot-reinstall-mysql-server-after-its-purge也没有用。 (I have even removed /var/lib/mysql and /etc/mysql). (我什至删除了/ var / lib / mysql和/ etc / mysql)。

Here's what happens when I try to start mysql: 这是我尝试启动mysql时发生的情况:

root@lamp-512mb-nyc1-01:~/etc/mysql# sudo /etc/init.d/mysql start
[....] Starting mysql (via systemctl): mysql.serviceJob for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
failed!

Here's what "systemctl status mysql.service" shows: 这是“ systemctl status mysql.service”显示的内容:

root@lamp-512mb-nyc1-01:~/etc/mysql# 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 Tue 2017-10-24 13:40:38 UTC; 13s ago
Process: 21324 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
Process: 21315 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 21324 (code=exited, status=1/FAILURE);         : 21325 (mysql-systemd-s)
Tasks: 2
Memory: 18.2M
  CPU: 423ms
CGroup: /system.slice/mysql.service
       └─control
         ├─21325 /bin/bash /usr/share/mysql/mysql-systemd-start post
         └─21357 sleep 1

Oct 24 13:40:38 lamp-512mb-nyc1-01 systemd[1]: Starting MySQL Community Server...
Oct 24 13:40:38 lamp-512mb-nyc1-01 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE

I have seen several questions related to mysql-server 5.7 upgrade on ubuntu, but couldn't find anything that worked. 我已经在ubuntu上看到了几个与mysql-server 5.7升级有关的问题,但是找不到任何有效的方法。 Please help. 请帮忙。 Thanks in advance. 提前致谢。

Save your data (/var/lib/mysql) and totally remove MySQL: 保存您的数据(/ var / lib / mysql)并完全删除MySQL:

  1. apt purge mysql* mariadb*
  2. Remove files files from /var/lib/mysql , /etc/mysql , /lib/systemd/system/mysql.service , /usr/share/mysql /var/lib/mysql/etc/mysql/var/lib/mysql /lib/systemd/system/mysql.service /usr/share/mysql /lib/systemd/system/mysql.service /usr/share/mysql /lib/systemd/system/mysql.service/usr/share/mysql删除文件文件
  3. Install MySQL again 再次安装MySQL
  4. Check if it starts 检查它是否开始
  5. Bring data back (if needed) 带回数据(如果需要)
  6. Check logs journalctl -xe 检查日志journalctl -xe

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM