FreeKB - mySQL / MariaDB Install MySQL on Linux
mySQL / MariaDB - Install MySQL on Linux

Use apt-get or yum to install the MySQL server. Be careful to observe if MySQL or MariaDB is installed. Some distributions will actually install MariaDB instead of MySQL.

apt-get install mysql-server
yum install mysql


Add the MySQL Authentication library modules to Apache:

apt-get install libapache2-mod-auth-mysql


Install the following package if your website will be using PHP:

apt-get install php5-mysql





Secure MySQL:



The ps command can be used to determine if your system is using init or systemd. If PID 1 is init, then you will use the service command. If PID 1 is systemd, then you will use the systemctl command.

If your system is using systemd, use the systemctl command to start and enable mysql.

systemctl enable mysql
systemctl start mysql
systemctl status mysql


If your system is using init, use the chkconfig and service commands to start and enable mysql.

chkconfig mysql on
service mysql start
service mysql status



Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter dc068 in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |