Database Setup

ID #1031

How do I setup user permissions under MySQL?

Suppose you have an account with multiple domains and you wish to create a database for each domain. After you have created the domain with 'control_apache', try the following:

  1. Create the database:
    $ control_mysql add DB_NAME
  2. Create the database user for this domain:
    $ control_mysql adduser USER_NAME
  3. Set the new user's password:
    $ control_mysql password USER_NAME

At this point, the new user exists, but has no permissions. Your default MySQL user must GRANT permissions to this new user.


(Note, if you have never logged into MySQL or phpMyAdmin with your default MySQL user, do 'control_mysql password SHELL_LOGIN_NAME' to set a password.)

To set the GRANTS do the following:

  1. Log into MySQL on the command line or via phpmyadmin.geekisp.com using your standard MySQL account.
  2. Execute the following query:
    GRANT ALL PRIVILEGES ON DB_NAME.* TO USERNAME@'%'


In a moment or two, the permissions will take effect. Try logging into MySQL or phpMyAdmin with the new username and password - you should see DB_NAME in your list of available databases.

Tags: -

Related entries:

Last update: 2007-10-31 13:37
Author: george2
Revision: 1.1

Digg it! Print this record Send to a friend Show this as PDF file
Propose a translation for Propose a translation for
Please rate this entry:

Average rating: 0 out of 5 (0 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry