#---下面創建了一個賬戶爲'test',密碼爲'test'的賬戶
mysql>grant select,insert,delete,update on test.* to test identified by 'test';
Query OK, 0 rows affected (0.00 sec)
#---select,insert,delete,update 指定該用戶擁有的權限
#---test.* 指定該用戶的這些權限可用於哪些數據庫,*代表全部(通配符)
#---to test 指定用戶,如果原來沒有這個用戶,grant命令創建一個新的用戶名
#---indentified …… 設置賬戶密碼
登錄測試
[student1@linux115 ~]$ mysql -u test -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 688
Server version: 5.0.56-enterprise-gpl-log Source
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>