MySQL帳號權限相關指定
* create user without password
CREATE USER 'abcuser'@'from_ip';
* create user with password
CREATE USER 'abcuser'@'from_ip' identified by 'abc_pwd';
* set password to user
SET PASSWORD FOR 'abcuser'@'from_ip' = PASSWORD('abc_pwd');
* grant all privilege to all database
GRANT ALL PRIVILEGES ON *.* TO 'abcuser'@'from_ip';
* grant all privilege to single database(sdb)
GRANT ALL PRIVILEGES ON sdb.* TO 'abcuser'@'from_ip';
* grant select privilege to single database(sdb)
GRANT SELECT ON sdb.* TO 'abcuser'@'from_ip';
* drop user
DROP USER 'abcuser'@'from_ip';
留言
張貼留言