Creating multiple mysql databases with single user

The following are the instructions required for assigning  multiple databases to a single user.

Before you start the steps below, you must have your databases created within Plesk. Once you have finished creating the databases you want to assign to one username, please do the following:

Please note that [Cmd] indicates the follow is the command that needs to be entered into the SSH session.

1. log into SSH for your VPS
2. [Cmd] mysql -u admin -p
3. default password: setup
4. [Cmd] use mysql;
5. [Cmd] INSERT INTO db VALUES('localhost','name_of_second_db','same_username_used_for_first_db','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');

Example: INSERT INTO db VALUES('localhost','admin_db2','dbuser','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');

6. [Cmd] use psa;
7. [Cmd] select * from data_bases;

Take note of the 'id' of your second MySQL database.

8. [Cmd] select * from db_users;

Take note of the 'account_id' of your username for the first db.

9. INSERT INTO db_users VALUES('','same_username_used_for_first_db',same_account_id_for_first_user,db_id);

Example: INSERT INTO db_users VALUES('','dbuser',5,3);

10. [Cmd] exit

11. [Cmd] service mysqld restart

Finished.


Related Articles

No related articles were found.

Attachments

No attachments were found.

Article Details

Last Updated
25th of September, 2009

Would you like to...

Print this page  Print this page

 Subscribe me

Subscribe me  Bookmark Article

Remove Highlighting Remove Highlighting

Edit this Article

Quick Edit

Export to PDF


User Opinions

No users have voted.

How would you rate this answer?




Thank you for rating this answer.

Continue