Mysql下建立用户授权权限例子(2)_MySQL教程

编辑Tag赚U币
教程Tag:暂无Tag,欢迎添加,赚取U币!

推荐:mysql中alter数据表中增加、删除字段与表名修改例子
alter是非常强大的一个功能我们可以利用alter来修改数据表表名字体名及一些其它的操作了,下面一起来看看mysql中alter数据表中增加、删除字段与表名修改的一个例子. 修改删除mysql数据库中的数据内容: [root@hk ~]# /usr/local/mysql/bin/mysql -uroot -p'admin' #进

mysql> grant all on gbk.* to 'user'@'授权可连接主机' identified by 'admin123';    #这是Server端
[root@lamp ~]# /usr/local/mysql/bin/mysql -uroot -p'admin123' -h hk.t4x.org    #这是client端

补充:ALL PRIVILEGES权限包括:

mysql> show grants for 'byrd'@'localhost';
+-------------------------------------------------------------------------------------------------------------+
| Grants for byrd@localhost                                                                                   |
+-------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'byrd'@'localhost' IDENTIFIED BY PASSWORD '*01A6717B58FF5C7EAFFF6CB7C96F7428EA65FE4C' |
| GRANT ALL PRIVILEGES ON `gbk`.* TO 'byrd'@'localhost'                                                       |
+-------------------------------------------------------------------------------------------------------------+
mysql> revoke insert on `gbk`.* from 'byrd'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> show grants for byrd@'localhost';
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for byrd@localhost                                                                                                                                                                                                   |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'byrd'@'localhost' IDENTIFIED BY PASSWORD '*01A6717B58FF5C7EAFFF6CB7C96F7428EA65FE4C'                                                                                                                 |
| GRANT SELECT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `gbk`.* TO 'byrd'@'localhost' |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
ALL PRIVILEGES权限包括:GRANT SELECT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT,insert

分享:Mysql大小写敏感的问题
一、1 CREATE TABLE NAME(name VARCHAR(10)); 对这个表,缺省情况下,下面两个查询的结果是一样的: 代码如下: SELECT * FROM TABLE NAME WHERE name='clip'; SELECT * FROM TABLE NAME WHERE name='Clip'; MySql默认查询是不区分大小写的,如果需要区分他,必须在建表的

共2页上一页12下一页
来源:模板无忧//所属分类:MySQL教程/更新时间:2015-03-09
相关MySQL教程