1.先删除mysql(原来有的话)
按顺序执行以下命令
sudo apt-get autoremove --purge mysql-server-5.0
sudo apt-get remove mysql-server
sudo apt-get autoremove mysql-server
sudo apt-get remove mysql-common
清理残留数据
dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P
2.下载MySQL,配置文件,网址:
https://dev.mysql.com/downloads/repo/apt/
参考:https://blog.csdn.net/wm609972715/article/details/83759266
3.配置完之后,登入数据库,配置远程连接
mysql –u root –p
mysql> use mysql;
mysql> select host,user,authentication_string,plugin from user;
mysql> update user set host='%' where user='root';
mysql> flush privileges;