日期:2014-05-16 浏览次数:20819 次
mysql> use mysql
Database changed
mysql> insert into user(Host,User,Password) values("localhost","little_bill",password("1234"));
Query OK, 1 row affected, 3 warnings (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
E:\>mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.1.41-community MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database little_billDB;
Query OK, 1 row affected (0.03 sec)
mysql> grant all privileges on little_billDB.* to little_bill@localhost identified by '1234';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
mysql> use mysql Database changed mysql> DELETE FROM user WHERE User="little_bill" and Host="%"; Query OK, 1 row affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> exit Bye
mysql> CREATE USER 'little_bill'@'%' IDENTIFIED BY '123456'; Query OK, 0 rows affected (0.00 sec) mysql> CREATE DATABASE IF NOT EXISTS `little_billDB`; Query OK, 1 row affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON `little_billDB` . * TO 'little_bill'@'%'; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> exit Bye
mysql> drop user 'little_bill'@'%'; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec)