mysql创建用户授权

  服务器上好多库,为了不让某用户误操作别人的数据库,给他单独建个用户并授权。

  insert into mysql.user(Host,User,Password, ssl_cipher, x509_issuer, x509_subject) values("192.168.1.2","test",password("123"), '', '', '');

  FLUSH PRIVILEGES;
  grant all privileges on test.* to test@192.168.1.1 identified by '123';

  怎么让他登录,不能让他上sh,在他web上安装个phpMyAdmin,配置文件加上$cfg['Servers'][$i]['host'] = '192.168.1.2';

  让他用test 123 登陆就能操作这个test库了。

  

原文地址:https://www.cnblogs.com/wendao/p/5009785.html