操作1:"apt install mysql-server"
操作2: ”systemctl status mysql.service“ 状态正常进行操作3
操作3: "vim /etc/mysql/mysql.conf.d/mysqld.cnf" 修改值为 "bind-address=0.0.0.0"
操作4:”mysql -u root -p“ 默认无密码直接登录
操作5:
"create user 'root'@'%' identified by '123456';"
"grant all privileges on *.* to 'root'@'%';"
"alter user 'root'@'%' identified with mysql_native_password by '123456';"
"alter user 'root'@'localhost' identified with mysql_native_password by '123456';"
"FLUSH PRIVILEGES;"
操作6:返回操作4 使用新密码登录 成功即可以使用