ubuntu mysql怎么设置远程访问

  1. 进入mysql
  2.  	mysql -uroot -p;
    
  3. 允许ip为100.64.25.217(看你项目使用的那个mysql ip 你就设置那个)用root用户来访问test4下面的所有的表使用的密码是123456:
  4.  	grant all privileges on test4.* to 'root'@'100.64.25.217' identified by  '123456' with grant option;
    
  5. 让授权生效:
  6.  	flush privileges;
    
  7. 允许所有人都能访问你的数据库:
  8.  grant all privileges on test4.* to 'root'@'%' identified by  '123456' with grant option;
    
  9. 让授权生效:
  10. 	flush privileges;
    

猜你喜欢

转载自blog.csdn.net/zsx1314lovezyf/article/details/89765035