用户授权方法 你可以通过发出GRANT语句增加新用户: 代码如下 复制代码 shell> mysql --user=root mysql mysql> GRANT ALL PRIVILEGES ON *.* TO monty@localhost IDENTIFIED BY 'something' WITH GRANT OPTION; mysql> GRANT ALL PRIVILEGES ON *.* TO monty@"%" IDENTIFIED BY 'some…
1,查询mysql 数据库已经存在的用户: SELECT USER,HOST FROM MYSQL.USER; 2,创建mysql 用户: '; USERNAME:用户名 HOST:主机,PASSWORD:密码localhost:只可以本地登陆%:本地登陆,远程登陆10.99.10.2:指定登陆的ip 3, 删除mysql 用户: DROP USER 'USERNAME'@'HOST'; DROP USER 'chris'@'localhost'; 4,用户授权: 1,先创建测试数据库CREAT…
服务器上好多库,为了不让某用户误操作别人的数据库,给他单独建个用户并授权. 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.…