Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to create a user with permission to create database, import mysqldump files, create tables?

What is the command for that?


share|improve this question
up vote 2 down vote accepted

Short answer: in the MySQL client, run the following:

GRANT ALL PRIVILEGES ON *.* to username@hostname_or_ip identified by 'password';

Longer answer:

There is really excellent documentation in the MySQL Reference Manual on this topic. Take special note of the chapter on User Account Management.

share|improve this answer
I should add that this query should be executed from the "root" account: the one that has "WITH GRANT OPTION" privilege – kolypto Jul 28 '09 at 2:37

GRANT ALL ON *.* TO username@"%" IDENTIFIED BY "password";

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.