-2

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.

2
  • 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, 2013 at 4:15
  • Have you tried searching for how to do this and learning through online resources? Oct 28, 2013 at 8:28

1 Answer 1

0

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;

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .