laojiang:~ # mysql -uroot -proot
mysql> create database laojiang character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)
mysql> grant all privileges on laojiang.* to 'laojiang'@'%' identified by 'password';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on laojiang.* to 'laojiang'@'127.0.0.1' identified by 'password';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on laojiang.* to 'laojiang'@'localhost' identified by 'password';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on laojiang.* to 'laojiang'@'laojiang' identified by 'password';
Query OK, 0 rows affected (0.00 sec)
mysql> grant select on mysql.proc to laojiang;
Query OK, 0 rows affected (0.00 sec)
mysql> grant show databases on *.* to laojiang;
Query OK, 0 rows affected (0.00 sec)
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29911917/viewspace-1280953/
,如需转载,请注明出处,否则将追究法律责任。