目录
安装mysql
修改mysql配置文件
修改mysql root账号
修改阿里云安全组设置
apt-get update; apt-get install mysql-server; apt-get install mysql-client;
vi /etc/mysql/mysql.conf.d/mysqld.cnf
将
bind-address = 127.0.0.1
修改为
bind-address = 0.0.0.0
保存文件,重启服务
service mysql restart
进入/etc/mysql/查看文件debian.cnf
cat /etc/mysql/debian.cnf
用文件中的user和password进入mysql
mysql -u[user] -p[password]
执行SQL:
#修改root账号的host值 update user set host="%",plugin="mysql_native_password" where user="root"; #修改密码 alter user 'root'@'%' identified by '[密码]'; flush privileges;