Ubuntu 16.04安装Mysql5.7修改root密码

一、安装Mysqlmysql

sudo apt-get install mysql-serversql

sudo apt-get install mysql-client数据库

sudo apt-get install libmysqlclient-devide

二、修改root密码spa

sudo more /etc/mysql/debian.cnf
.net

用文件里的用户名密码登录Mysqlserver

use mysqlget

update user set plugin='mysql_native_password' where user='root';
string

update user set authentication_string=password('123') where user='root';
it

flush privillege;

三、配置远程访问

注释掉在/etc/MySQL/mysql.conf.d/mysqld.cnf里面的bind-address = 127.0.0.1

链接mysql数据库,修改user表

Grantall on *.* to 'root'@'%' identifiedby 'root用户的密码' withgrant option;flush privileges;