Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 have a VPS, and am having troubles with MySQL. I think I have created a database, but got lost.

I need to know how to:

  • Add a database, with the username, name of the database, and password.

  • Remove a database.

share|improve this question
could you please throw more light into this? Say what you tried? What is the problem your are facing? Kindly update with more information – ZVIK Oct 28 '13 at 4:15
Have you tried searching for how to do this and learning through online resources? – Drew Khoury Oct 28 '13 at 8:28
up vote 0 down vote accepted

if you are using mysql from the command line, you would connect to your mysql server with
mysql -u USER -p PASS

if that works you're at a mysql prompt >
type CREATE DATABASE my_new_database_name;
Then use a GRANT statement to create a new user with access only to that database; eg
GRANT ALL PRIVILEGES ON my_new_database_name.* TO 'new_user_name'@'%' IDENTIFIED BY 'new_password';
GRANT ALL PRIVILEGES ON my_new_database_name.* TO 'new_user_name'@'localhost' IDENTIFIED BY 'new_password';

You can see what databases you have with:
show databases;
and you can delete a database with DROP DATABASE my_new_database_name;

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.