Install MySQL Database Server CentOS Linux

Install MySQL Database Server CentOS Linux

Install MySQL Database Server CentOS

Install MySQL Database Server CentOS

MySQL Database is a popular choice of database for use in web applications, and is a central component of the widely used LAMP open source web application software stack. LAMP is an acronym for “Linux, Apache, MySQL, Perl/PHP/Python.” Free-software-open source projects that require a full-featured database management system often use MySQL.

Ubuntu / Debian package installation:

# sudo apt-get install mysql-server mysql-client

CentOS / RHELL package installation:

# sudo yum install mysql-server

Configure the mysql database server using the command

# sudo /usr/bin/mysql_secure_installation

Configuration file in mysql server

Edit /etc/my.cnf
# vi /etc/my.cnf

Verify the MySQL Database installation:

# mysql -V

If you have iptables running on the database server you’ll need to open a port in your server’s firewall (the default port is 3306).

# /sbin/iptables -I INPUT -p tcp --dport 3306 -m state --state NEW,ESTABLISHED -j ACCEPT
# /sbin/iptables -I OUTPUT -p tcp --sport 3306 -m state --state ESTABLISHED -j ACCEPT

Start MySQL database

# sudo /sbin/service mysqld start

Configure MySQL to start on boot

# sudo chkconfig mysqld on

Log in to MySQL on Linux Terminal

root@web_server# mysql -u root -p

Enter password:
 Welcome to the MySQL monitor. Commands end with ; or \g.
 Your MySQL connection id is 42
 Server version: 5.5.32-0ubuntu0.12.04.1 (Ubuntu)


MySQL Linux commands to start, stop, restart and get the current state of the process

#sudo /etc/init.d/mysql start
#sudo /etc/init.d/mysql stop
#sudo /etc/init.d/mysql restart
#sudo /etc/init.d/mysql status
Proudly powered by WordPress   Premium Style Theme by
%d bloggers like this: