create user ‘testuser’@’localhost’ identified BY ‘testpass’; //新建用户
grant all privileges on blog.* to testuser@localhost identified by ‘testpass’; //授权用户登录blog数据库
grant all privileges on *.* to testuser@”%” identified by “testpass”; //授权用户能远程连接mysql
grant all privileges on *.* to root@”%” identified by “123456”; //允许 root 用户登录
set password for ‘root’@’localhost’ = password(‘newpass’); //设置root密码
flush privileges;
mysqladmin -u root -p flush-tables // 解决table read only
—————————————————————————————–
如果连接不上,请注意设置iptables放行端口