ubutun升级到16.04后的一些问题

1,mysql的问题

同步更新到mysql 5.7了。

报错

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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.
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
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for systemd (229-4ubuntu4) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

解决办法

  1. Back up your my.cnf file in /etc/mysql and remove it
  2. Remove the folder /etc/mysql/mysql.conf.d/
  3. Verify you don’t have a my.cnf file stashed somewhere else (I did in my home dir!) or in /etc/alternatives/my.cnf.
  4. Backup and remove /etc/mysql/debian.cnf files (not sure if needed, but just in case)

    1
    2
    3
    `sudo apt purge mysql-server mysql-server-5.7 mysql-server-core-5.7
    sudo apt install mysql-server
    `
  5. In case your syslog shows an error like “mysqld: Can’t read dir of ‘/etc/mysql/conf.d/‘“ create a symbolic link ln -s /etc/mysql/mysql.conf.d /etc/mysql/conf.d Then the service should be able to start with service mysql start.

坚持原创技术分享,您的支持将鼓励我继续创作!