关注联楷|返回首页 | 网站案例 | 帮助中心

合作共赢、快速高效、优质的网站建设提供商

上海网站建设 

服务热线:021-61394118

上海联楷科技

建网站mysql添加用户

作者:佚名   时间:2012-05-03   分享到:

mysql>grant all privileges on vtdc.* to joe@10.163.225.87 identified by ‘123′;
给来自10.163.225.87的用户joe分配可对数据库vtdc所有表进行所有操作的权限,并设定口令为123。

mysql>grant all privileges on *.* to joe@10.163.225.87 identified by ‘123′;
给来自10.163.225.87的用户joe分配可对所有数据库的所有表进行所有操作的权限,并设定口令为123。

mysql>grant all privileges on *.* to joe@localhost identified by ‘123′;
给本机用户joe分配可对所有数据库的所有表进行所有操作的权限,并设定口令为123。

mysql添加用户方法

建立数据库gamesp

create database gamesp;

添加用户

grant all on 数据库名.* to 用户名@localhost identified by '密码';


grant all on gamesp.* to newuser@localhost identified by 'password';

 

添加一个远程用户,名为username密码为password
GRANT ALL PRIVILEGES ON *.* TO " IDENTIFIED BY 'password'

说明:

(1)grant all 赋予所有的权限

(2)gamesp.* 数据库 gamesp 中所有的表

(3)newuser 用户名

(4)@localhost 在本地电脑上的 mysql server 服务器

(5)identfified by 'password' 设置密码

删除用户
use mysql
mysql>Delete FROM user Where User="xxxxx" and Host="localhost";
mysql>flush privileges;


修改密码
mysqladmin -uroot -plk317921web password "111111"

 



如没特殊注明,文章均为上海联楷网络原创,转载请注明来自:http://www.linksj.com/contact/20151229/n7559.html

上海联楷网络新闻