Thursday, November 1, 2012

Steps to install mysql on linux

How to install mysql on linux

How to install mysql on linux???

How to check whether MySQL is running on your server or not????

Just 5 steps to install and check!! 


Installing MySQL: 

If you have internet then install it through apt-get or yum!!!!
Use apt-get or yum to install the MySQL from internet!
apt-get -f install mysql*

OR

yum install mysql*

If you don't have internet then get the rpm or deb files and install !!
If you have RPM files!
rpm -ivh MySQL-server-community-5.1.25-0.rhel5.i386.rpm MySQL-client-community-5.1.25-0.rhel5.i386.rpm

If you have DEB files!
dpkg -i MySQL-server-community-5.1.25-0.rhel5.i386.deb MySQL-client-community-5.1.25-0.rhel5.i386.deb


Setting the ROOT Password!!

/usr/bin/mysqladmin -u root password 'MySecure$Password'


Take Precautions to offer a secured DB platform!


The best option is to run the mysql_secure_installation script that will take care of all the typical security related items on the MySQL as shown below. On a high level this does the following items:

1) Change the root password
2) Remove the anonymous user
3) Disallow root login from remote machines
4) Remove the default sample test database

so 

/usr/bin/mysql_secure_installation <--/



Verify and log-into your MySQL!!

For verification use MySQL to show his version details using

mysql -V
Output: mysql  Ver 14.15 Distrib 5.1.28-rc, for varra-linux-gnu (i686) using readline 5.1

So looks fine !! then try to loginto your MySQL

mysql -u root -h localhost -p



DONE!!!!!!! Simple!!?? ;)

Popular Posts