Ubuntu 16.04下安装mysql

安装

sudo apt-get update
sudo apt-get install mysql-server
sudo apt install mysql-client
sudo apt install libmysqlclient-dev
sudo apt-get install -f

sudo netstat -tap | grep mysql

sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
1、注释掉bind-address = 127.0.0.1:

mysql-uroot-p你的密码

GRANT ALL PRIVILEGES ON . TO ‘root’@’%’ IDENTIFIED BY ‘你的密码’ WITH GRANT OPTION;

flush privileges;

service mysql restart

#服务管理
#启动
sudo service mysql start
#停止
sudo service mysql stop
#服务状态
sudo service mysql status

-------------本文结束感谢您的阅读-------------