每个版本可能不一样:
测试是Ubuntu 14.04版本,mysql5.7.10官网下载wget -c http://downloads.mysql.com/archives/get/file/mysql-server_5.7.10-1ubuntu14.04_amd64.deb-bundle.tartar -xvf ***deb-bundle.tar 大概有10+个deb包官网顺序http://dev.mysql.com/doc/refman/5.7/en/linux-installation-debian.html
tar -xvf mysql-server_MVER-DVER_CPU.deb-bundle.tarsudo apt-get install libaio1sudo dpkg-preconfigure mysql-community-server_*.debsudo dpkg -i mysql-{common,community-client,client,community-server,server}_*.deb还敲了一阵sudo apt search libaio 和sudo apt install libaio1指令
后来执行sudo apt-get -f install 解决回退5.7到5.6.21的重装过程
删除 mysqlsudo apt-get autoremove --purge mysql-serversudo apt-get remove mysql-serversudo apt-get autoremove mysql-serversudo apt-get autoremove mysql-common清理残留数据dpkg -l |grep ^rc|awk '{print $2}' |grep mysql | sudo xargs dpkg -P重装mysql,官网文档上的顺序
tar -xvf mysql-server_MVER-DVER_CPU.deb-bundle.tarsudo apt-get install libaio1sudo dpkg -i mysql-common_MVER-DVER_CPU.debsudo dpkg-preconfigure mysql-community-server_MVER-DVER_CPU.debsudo dpkg -i mysql-community-server_MVER-DVER_CPU.debsudo dpkg -i mysql-community-client_MVER-DVER_CPU.debsudo dpkg -i libmysqlclient18_MVER-DVER_CPU.deb=========================================================
sudo /etc/init.d/mysql start 服务启动sudo /etc/init.d/mysql stop使用户可以从其它地址可以访问服务器
首先得修改/etc/mysql/my.cnf文件,将bind-address = 127.0.0.1修改为 0.0.0.0并赋予其访问权限grant all on *.* to root@'%' identified by "passwd"; flush privileges;升级过程中error用:mysql_upgrade mysql -h127.0.0.1 -uroot -p123456