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

Updated:   |  mySQL / MariaDB articles

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



Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee


Add a Comment

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