1.安装mysql5.7
sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install libmysqlclient-dev
2.修改配置文件
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
# bind-address = 127.0.0.1
3.进入mysql命令行执行sql语句
mysql -u root -p
#回车后输入密码
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;
4.重启mysql服务
service mysql restart
网友评论