MySQL的用户账户管理

1、开启MySQL远程连接
  1、sudo -i
  2、cd /etc/mysql/mysql.conf.d/
  3、vim mysqld.cnf
    #bind-address = 127.0.0.1
    把前面#去掉,保存退出。
  4、/etc/init.d/mysql restart
2、添加授权用户
  1、用root用户登录mysql
    mysql -uroot -p123456
  2、授权
    grant 权限列表 on 库.表 to "用户名"@"%"
    identified by "密码" with grant option;

  权限列表:all privileges 、select 、insert
  库.表 : *.* 所有库的所有表

3、示例
  mysql> grant all privileges on zengsf.* to "zengsf"@"%" identified by "123" with grant option;
  Query OK, 0 rows affected, 1 warning (0.11 sec)

猜你喜欢

转载自www.cnblogs.com/zengsf/p/9581426.html