一、安装
sudo apt install mysql-server
安装好mysql后进入mysql授权
sudo mysql
use mysql;
update user set host='%' where user='root';
grant all privileges on *.* to 'root'@'%' ;
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'admin';
flush privileges;
ctrl+d 退出mysql 更改配置文件 将127.0.0.1 改为 0.0.0.0
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
sudo /etc/init.d/mysql restart
二、卸载
sudo apt-get autoremove mysql* --purge
sudo apt-get remove apparmor
dpkg --list|grep mysql
网友评论