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.
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.
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;