2009年11月18日星期三

工作日誌 之 如何在Mysql上創建用戶

儘管這些東西很簡單的, google一下也能找到,但是經常使用,一時找不到很影響工作效率,所以做一個日誌, 備忘一下

mysql> create user root@'%';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on mysqlUser.* to mysqluser;  --mysqlUser.* 是Database的名字
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on *.* to root@'%';
Query OK, 0 rows affected (0.00 sec)

mysql> set password for root@'%'=password('password');
Query OK, 0 rows affected (0.00 sec)

 

mysql> create user myadmin
    -> ;
Query OK, 0 rows affected (0.00 sec)

mysql> set password for myadmin =password('myinno');
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on mydiscuz.* to myadmin;
Query OK, 0 rows affected (0.00 sec)

没有评论:

发表评论