How to install mysql server in RedHat and CentOS

In this post we will learn about,how to install mysql server in RedHat and CentOS. MySQL is a relational database management system (RDBMS), and ships with no GUI tools to administer MySQL databases or manage data contained within the databases.
Read More About MySQL Server

By-Default Port no. of MySQL : 3306 (It is a TCP based protocol)

In Red Hat or CentOS install the MySQL Server by following command

yum install -y mysql-server

To start/stop/restart the mysql-server

To Start the MySQL server : /etc/init.d/mysqld start

To Stop the MySQL Server : /etc/init.d/mysqld stop

To Restart the MySQL Server : /etc/init.d/mysqld restart

To Check the status of MySQL Server : /etc/init.d/mysqld status

How To Check on which port no. the mysql is running

# netstat -tanp|grep mysqld
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 17925/mysqld

The output of netstat command shows the MySQL server is running at port no. 3306 in localhost IP Address(127.0.0.1) ,it is Listening and have the PID no. 17925 with program name mysqld

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.