mysql grant privileges

The EXECUTION, FILE, PROCESS, RELOAD, REPLICATION CLIENT, REPLICATION SLAVE, SHOW DATABASES, SHUTDOWN, and SUPER privileges are administrative privileges that can only be granted globally (using ON *.* syntax).

 

GRANT FILE ON *.* TO 'mysql_user'@'localhost'

 

mysql -uroot -p

create database monitor charset=utf8;

#赋权限

#可以从其他主机链接过来
GRANT ALL PRIVILEGES ON monitor.* TO 'monitor_account'@'%' IDENTIFIED BY 'asdfio123k9' WITH GRANT OPTION;

or
#本机链接
GRANT ALL PRIVILEGES ON monitor.* TO 'monitor_account'@'localhost' IDENTIFIED BY 'asdfio123k9' WITH GRANT OPTION;

or
#指定IP链接
GRANT ALL PRIVILEGES ON monitor.* TO 'monitor_account'@'10.22.33.44' IDENTIFIED BY 'asdfio123k9' WITH GRANT OPTION;

#test
mysql -u monitor_account -pasdfio123k9 monitor -h 10.16.254.130



grant:

GRANT ALL PRIVILEGES ON eagleyes_spider.* TO 'app'@'%' IDENTIFIED BY 'admin2010' WITH GRANT OPTION ;
 test:

mysql -uapp -p admin2010 eagleyes_spider -h 12.34.56.78

 

 

你可能感兴趣的:(mysql)