www.netcreator.us
NETCreator - News, Scripts, Hosting, CMS, Tutorials

Webmaster Forum

Now, you don't need to wait so much with your question.

Home     |     Ask a Question

How to create a MySQL database on VPS?

Are there any ways to create a MySQL database on my VPS without using phpMyadmin or user interface?

I mean that I want to create database, username, password for db by commands on my console.

Is it possible?
in Programming MySQL
asked by rosanne

Discussions (1)

Hello!

1. CONNECT TO SERVER

How to connect to server: http://netcreator.us/webmaster-forum/19/how-to-connect-to-server

2. HOW TO INSTALL MYSQL

Now, if you don't have MySQL installed on your server, you can do it by running:
sudo yum install mysql-server
and
sudo /sbin/service mysqld start

3. HOW CREATE DATABASE AND USER

After installs completed, log into your MySQL database as root by typing:

mysql -p
Create a database:

CREATE DATABASE new_database_name_here;
Create an user and set password:

GRANT ALL PRIVILEGES ON new_database_name_here.* TO 'new_username_here'@'localhost' IDENTIFIED BY "new_database_password_here";
Flush privileges (like refresh)

flush privileges;
Exit MySQL:

exit;
If you have PHP installed on, you can connect to your db through PHP and then run same jobs.
by NETCreator

Reply to this question

Please Login to Reply
SEARCH QUESTIONS & ANSWERS
ASK A QUESTION