หน้าเว็บ

วันจันทร์ที่ 24 กันยายน พ.ศ. 2555

create drop and grant user mysql linux command line

Create user
...
...
YourHost@Server:~$ mysql - u root -p
Enter password : 

...
mysql> create user 'redcrow'@'localhost' identified by 'redcrowpassword';
Query OK, 0 rows affected (0.00 sec)

//conect from any host will use '%'
//mysql> create user 'redcrow'@'%' identified by 'redcrowpassword';
//Query OK, 0 rows affected (0.00 sec)

mysql>
...
...
Drop user
...
...
YourHost@Server:~$ mysql - u root -p
Enter password : 

...
mysql> drop user 'redcrow'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql>
...
...
Grant select, insert, update, delete, create, drop
...
...
YourHost@Server:~$ mysql - u root -p
Enter password : 

...
mysql> grant select, insert, update, delete, create, drop 
    -> on hippdb.*
    -> to 'hippo'@'localhost';
Query OK, 0 rows affected (0.00 sec)

//mysql> grant all privileges 
//    -> on hippdb.*
//    -> to 'hippo'@'localhost';
//Query OK, 0 rows affected (0.00 sec)


mysql>
...
...

ไม่มีความคิดเห็น:

แสดงความคิดเห็น