美文网首页
ubuntu 18 安装 mysql5.7

ubuntu 18 安装 mysql5.7

作者: 了不起的ACER | 来源:发表于2020-07-23 17:09 被阅读0次
一、安装
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

相关文章

网友评论

      本文标题:ubuntu 18 安装 mysql5.7

      本文链接:https://www.haomeiwen.com/subject/gbmhlktx.html