|
ابوعبدالله
|
|
تاريخ التسجيل: 23 - 12 - 2004
الدولة: السعودية
المشاركات: 4,873
شكر غيره: 722
تم شكره 803 مرة في 529 مشاركة
معدل تقييم المستوى: 10
|
|
|
Procedure for setting up a MySQL user account By Shell
Procedure for setting up a MySQL user account
Login in as mysql root user (at shell prompt type following command:):
كود PHP:
$ mysql -u root -p
OR
كود PHP:
$ mysql -u root -h myserver-sever.com -p
Create a new mysql database called demo
كود PHP:
mysql> CREATE DATABASE demo;
Create a new user called user1 for database demo
كود PHP:
mysql> GRANT ALL ON demo.* TO user1@localhost IDENTIFIED BY 'mypassword';
Note: GRANT ALL means all privileges i.e.
user is permitted do anything. She can read, modify or delete data, but only on tables in the demo database. She cannot access any other database.
How do I connect to MySQL server using user1 account?
User user1 can connect to mysql server demo database using following command:
كود PHP:
$ mysql -u user1 -p demo
OR
كود PHP:
$ mysql -u user1 -h mysql.server.com -p demo
Where,
-u user1: MySQL Username
-h : MySQL server name (default is localhost)
-p : Prompt for password
demo: demo is name of mysql database (optional)
|