-rw-r--r-- 1 root ftp 4693686 Nov 27 00:59 MySQL-3.22.27-2c.i386.rpm -rw-r--r-- 1 root ftp 4041769 Nov 27 00:59 MySQL-3.22.27-2c.src.rpm -rw-r--r-- 1 root ftp 541043 Nov 27 00:59 MySQL-bench-3.22.27-2c.i386.rpm -rw-r--r-- 1 root ftp 2050704 Nov 27 00:59 MySQL-client-3.22.27-2c.i386.rpm -rw-r--r-- 1 root ftp 601871 Nov 27 00:59 MySQL-devel-3.22.27-2c.i386.rpm |
[root@test /root]# rpm -ivh MySQL-3.22.27-2c.i386.rpm [root@test /root]# rpm -ivh MySQL-client-3.22.27-2c.i386.rpm [root@test /root]# rpm -ivh MySQL-devel-3.22.27-2c.i386.rpm |
[root@test /root]# mysql mysql |
Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 212 to server version: 3.22.27 Type 'help' for help. mysql> |
mysql> UPDATE user SET password=password('新密碼') where user='root'; Query OK, 0 rows affected (0.00 sec) Rows matched: 2 Changed: 0 Warnings: 0 |
mysql> DELETE FROM user WHERE User = ''; Query OK, 0 rows affected (0.00 sec) Rows matched: 2 Changed: 0 Warnings: 0 |
mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) |
mysql> exit Bye [root@test root]# |
[root@test root]# mysql mysql -uroot -p新密碼 Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 29 to server version: 3.22.27 Type 'help' for help. mysql> exit Bye [root@test root]# |
[root@test root]# mysql 資料庫名稱 -u使用者名稱 -p密碼 |
[root@test root]# mysqladmin -uroot -p密碼 create 資料庫名稱 |
[root@test root]# mysqladmin -uroot -p密碼 drop 資料庫名稱 |
[root@test root]# mysqladmin -uroot -p密碼 shutdown |
[root@test root]# mysql mysql -uroot -p密碼 Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 29 to server version: 3.22.27 Type 'help' for help. mysql> |
mysql> insert into user values ('host','user',password('密碼'),'y','y','y','y','y','y','y','y','y','y','y','y','y','y'); |
1.Select_priv | 2.Insert_priv | 3.Update_priv | 4.Delete_priv | 5.Index_priv |
6.Alter_priv | 7.Create_priv | 8.Drop_priv | 9.Grant_priv | 10.References_priv |
11.Reload_priv | 12.Shutdown_priv | 13.Process_priv | 14.File_priv |
mysql> GRANT 權限 ON 資料庫(或資料表TABLE) TO user@host IDENTIFIED BY '密碼'; |
ALL PRIVILEGES | ALTER | CREATE | DELETE | DROP |
FILE | INDEX | INSERT | PROCESS | REFERENCES |
RELOAD | SELECT | SHUTDOWN | UPDATE | USAGE |
SELECT | INSERT | UPDATE | DELETE | CREATE |
DROP | INDEX | ALTER |
SELECT | INSERT | UPDATE |
mysql> GRANT ALL PRIVILEGES ON *.* TO user@host IDENTIFIED BY '密碼'; |
mysql> GRANT SELECT,INSERT,UPDATE ON 資料庫名.* TO user@host IDENTIFIED BY '密碼'; |
mysql> REVOKE 權限 ON 資料庫(或資料表TABLE) TO user@host IDENTIFIED BY '密碼'; |
mysql> FLUSH PRIVILEGES; |
[root@test root]# mysqlaccess host user 資料庫名 -U root -P 密碼 |
[root@test root]# mysqlaccess mail.hmes.kh.edu.tw fm focalmail -U root -P nnyyjj |
mysqlaccess Version 2.03, 27 Feb 1997 By RUG-AIV, by Yves Carlier (Yves.Carlier@rug.ac.be) This software comes with ABSOLUTELY NO WARRANTY. +++USING FULL WHERE CLAUSE+++ +++USING FULL WHERE CLAUSE+++ +++USING FULL WHERE CLAUSE+++ Access-rights for USER 'fm', from HOST 'mail.hmes.kh.edu.tw', to DB 'focalmail' +-----------------+---+ +-----------------+---+ | Select_priv | Y | | Shutdown_priv | Y | | Insert_priv | Y | | Process_priv | Y | | Update_priv | Y | | File_priv | Y | | Delete_priv | Y | | Grant_priv | Y | | Create_priv | Y | | References_priv | Y | | Drop_priv | Y | | Index_priv | Y | | Reload_priv | Y | | Alter_priv | Y | +-----------------+---+ +-----------------+---+ NOTE: A password is required for user `fm' :-( The following rules are used: db : 'No matching rule' host : 'Not processed: host-field is not empty in db-table.' user : '','fm','017186377a52afaf','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'' BUGs can be reported by email to Yves.Carlier@rug.ac.be [root@test /root]# |
歡迎光臨 ADJ網路實驗室 (http://dz.adj.idv.tw/) | Powered by Discuz! 6.0.0 |