How to Install MySQL on Linux

I will explain how to install MySQL on Linux [Redhat, Fedora] platform.

Type the following command as root user:
# yum install mysql-server mysql

Start MySQL Service:-
To start mysql server type the following command:-
# chkconfig mysqld on
# /etc/init.d/mysqld start

 Setup mysql root password:-
# mysqladmin -u root password yourpass

Connecting to MySQL:-
# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7369

Vishal Vyas


  1. which Port to allow in Iptable rules?

  2. Hi,

    MySQL is open source database server and by default it listen on TCP port 3306.

    iptables -A INPUT -i eth0 -p tcp -m tcp --dport 3306 -j ACCEPT



Post a Comment

Popular posts from this blog

Another instance of Certbot is already running - Solved - Linux guru

Install Apache Using Ansible Playbooks

1 node(s) had taints that the pod didn't tolerate Solved

Setup password less SSH on linux

Manage GCP bucket using gsutil command