Server - System - Manager - CentOS, Operation System, VBB, HACKING AND SECURITY

Go Back   Server - System - Manager - CentOS, Operation System, VBB, HACKING AND SECURITY > CentOS Việt Nam - Viet Nam Linux CentOS Community > Cài đặt CentOS và ứng dụng > MySQL trên CentOS

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-09-2008
Lovelinux's Avatar
Super Moderator
 
Join Date: Jun 2008
Posts: 221
Thanks: 22
Thanked 46 Times in 24 Posts
Default Global Permissions: Cho phép người dùng hoặc root remote connect, get control.

Global Permissions:
Cho phép tại bất kỳ host nào:
GRANT ALL PRIVILEGES ON *.* to root IDENTIFIED BY '123abc' WITH GRANT OPTION;
hoặc
GRANT ALL PRIVILEGES ON *.* to root@'%' IDENTIFIED BY '123abc' WITH GRANT OPTION;

chỉ cho phép connect từ localhost
GRANT ALL PRIVILEGES ON *.* to root@localhost IDENTIFIED BY '123abc' WITH GRANT OPTION;

//trong đó 123abc là passwd.

Khi chỉ cho phép trên 1 DB cố định:
GRANT ALL PRIVILEGES ON joedb.* to joe IDENTIFIED BY 'abcde' WITH GRANT OPTION;





mysql> select Host, User, Password, Grant_priv from user;

+---------------+---------+------------------+------------+
| Host | User | Password | Grant_priv |
+---------------+---------+------------------+------------+
| localhost | root | 123456789abcdefg | Y |
| % | joe | abcdefg123456789 | N |
| % | joe2 | abcdefg456712345 | N |
+---------------+---------+------------------+------------+


mysql> select Host, Db, User, Grant_priv from db;

+-----------+------------------+---------+------------+
| Host | Db | User | Grant_priv |
+-----------+------------------+---------+------------+
| % | test | | N |
| % | test\_% | | N |
| % | joedb | joe | Y |
| % | mydb2 | joe2 | Y |
+-----------+------------------+---------+------------+

cho phép ng dùng joe -> có quyền trên joedb khi remote
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:50 AM.


© Diễn đàn HackingArt (HA) được xây dựng và phát triển bởi các thành viên.
+ Diễn đàn HackingArt là nơi trao đổi của các webmaster chuyên nghiệp.