Need a Minecraft server? BeastNode delivers awesome performance at a great value!

SHOP FOR PLANS NOW


How to Install a MySQL Server on your CentOS VPS

Install MySQL on your Linux Server

This guide is based on a standard install of CentOS - other distributions are not guaranteed.

To install MySQL, just run these commands:

sudo yum install mysql-server

 

sudo service mysqld start


Set the root password:

mysqladmin -u root password 'passwordhere'

In some cases you may need to use this command instead of the above to set the password (hit enter if it asks for an initial password):

mysql_secure_installation


To access the MySQL shell:

mysql -u root -p


Enter your password created as above and you'll be presented a command line with:

mysql>


Some basic MySQL commands that you can use (all commands must end with a semicolon):


Show all databases:

SHOW DATABASES;


Enter/use a database:

USE databasename;


Show tables (after you used a database):

show tables;


Create a database:

CREATE DATABASE databasename;


Delete a database:

DROP DATABASE databasename;


Exit the MySQL prompt:

\q




MySQL server management commands:


Start the MySQL server:

sudo service mysqld start


Restart the MySQL server:

sudo service mysqld restart


Stop the MySQL server:

sudo service mysqld stop
  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

Protect SSH with Fail2Ban on CentOS 6

Fail2Ban is an SSH security program that blocks SSH brute force attempts on your server (as well...

Changing the Operating System / Reformatting your VPS

In order to change the operating system on your VPS or reformat it, you will need to login to the...

How to Use a BeastNode VPS to Backup Your Minecraft Server

This guide will explain the basic steps for you to create your own backup VPS (running on CentOS...

How to Install Apache Web Server and PHP on CentOS VPS

How to Install the Apache Web Server and PHP on CentOS VPSThis guide will explain the basics on...

Operating System Templates / ISOs

OpenVZ Templates: CentOS 5 (x86_64/x86) CentOS 6 (x86_64/x86) CentOS 6 Minimal (x86_64/x86)...