2009年11月28日

MYSQL 權限賦予語法

GRANT ALL ON *.* TO root@192.168.1.52 IDENTIFIED BY '123123' WITH GRANT OPTION;
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE ON opencms.* TO root@192.168.1.52 IDENTIFIED BY '123123';
GRANT ALL PRIVILEGES ON *.* TO root@192.168.1.52 IDENTIFIED BY '123123' WITH GRANT OPTION;
FLUSH PRIVILEGES;

  • GRANT ALL ON *.* TO 'username'@'localhost' IDENTIFIED BY 'passowrd'
  • ALL: 授權的權限(SELECT, INSERT .... etc)
  • *.*: Table Name, Db_name.*, 指定可以存取哪些Db/Table
  • username: 要新增的 username
  • localhost: 可從哪邊來存取, 可用 %
  • password: 密碼

沒有留言: