mysql建立用户及数据库并指定用户权限

$ mysql -uroot

mysql> insert into mysql.user(Host,User) values(“localhost”,”game”);
Query OK, 1 row affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> create database game;
Query OK, 1 row affected (0.00 sec)

mysql> grant all privileges on game.* to game@localhost;
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

发布者

admin

互联网web开发管理