当前位置:Gxlcms > 数据库问题 > MySQL 基础操作

MySQL 基础操作

时间:2021-07-01 10:21:17 帮助过:3人阅读

Mysql 新建用户,授权,让某个用户只能访问指定的数据库
localhost版,只能在本地登录使用:
insert into mysql.user(Host,User,Password) values("localhost","test3",password("test3"));
grant select on ‘kuaibei‘.* to test3@localhost identified by ‘test3‘;
flush privileges;
%版,任何IP地址都能登录使用:

insert into mysql.user(Host,User,Password) values("%","test3",password("test3"));

grant select on ‘kuaibei‘.* to test3@"%" identified by ‘test3‘;

flush privileges;

-----------------------------------------------------------------------------------------------------

 

MySQL修改root密码???
mysql -u root
mysql> use mysql;
mysql> UPDATE user SET Password = PASSWORD(‘newpass‘) WHERE user = ‘root‘;
mysql> FLUSH PRIVILEGES;

 

MySQL 基础操作

标签:oca   into   new   update   本地   nbsp   flush   访问   sel   

人气教程排行