Blogger Information
Blog 4
fans 0
comment 0
visits 7875
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
mysql创建用户并授予权限
colonel的博客
Original
3374 people have browsed it

1、创建用户:create user 'username' @ 'host' identfied by 'password';

 username:用户名;

host:指定在哪个主机上可以登录,本机可用localhost,%通配所有远程主机;

password:用户登录密码;


2、授权:grant all privileges on *.* to `webuser` @ `%` identified by 'colonel';

    格式:grant 权限 on 数据库名.表名 to 用户@登录主机 identified by "用户密码";

   *.* 代表所有权(匹配所有数据库);

@ 后面是访问MySQL的***端IP地址(或是 主机名) % 代表任意的***端,如果填写 localhost 为本地访问(那此用户就不能远程访问该mysql数据库了)。


3、刷新权限:flush privileges;


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post