Ubuntu 14.04.5 LTS 默认安装的MySQL版本为5.5.57,以下为升级到MySQL 5.6操作步骤。
- 下载并安装安装源
wget https://repo.mysql.com//mysql-apt-config_0.8.9-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.9-1_all.deb
- 更新apt-get索引
sudo apt-get update
- 安装MySQL
sudo apt-get install mysql-server
- 升级数据库文件版本
sudo mysql_upgrade -uroot -p'youpassword'
- 重启mysql,并检查数据是否正常
sudo service mysql restart
mysqlcheck -uroot -p'youpassword' --all-databases
- 检查数据库版本
mysql -uroot -p
select version();
报错解决
- No directory, logging in with HOME=/
sudo service mysql stop
sudo usermod -d /var/lib/mysql/ mysql
sudo service mysql start
- mysqld_safe Can't log to error log and syslog at the same time. Remove all --log-error configuration options for --syslog to take effect.
注释/etc/mysql/mysql.conf.d/mysqld.cnf文件中的"log-error=/var/log/mysql/error.log",重启mysql服务
或者
注释/etc/mysql/conf.d/mysqld_safe_syslog.cnf文件中的"syslog",重启mysql服务