How to install mysql on linux

 

 

 

 

 

 

easy steps and detalied steps for installing mysql on your local and live machine 

Installing mysql on linux:

The installation instructions in this chapter refer to MySQL Community Server 5.5.21, the
current production version of the software. This version number can be read as “revision
number 21 of minor release 5, of the major version 5 of the MySQL server software.”
Revisions and minor releases do not follow a set release schedule. When enhancements or
fixes are added to the code and thoroughly tested, a new version is released with a new
revision or minor version number.
By the time you purchase this book, the version number might have changed to 5.5.22 or
later. If so, read the list at http://dev.mysql.com/doc/refman/5.5/en/news-5-5-x.html for
any installation/configuration process changes.

How to Get MySQL
MySQL AB was the name of the company that developed, maintained, and distributed
the MySQL database server; through a series of acquisitions (Sun Microsystems
purchased MySQL AB, and Oracle Corporation purchased Sun Microsystems), database
giant Oracle now owns MySQL. However, the MySQL Community Edition of the
software remains open source, is supported by open source developers, and is freely
available on the MySQL website at http://www.mysql.com/. Binary distributions for
all platforms, installer packages for Mac OS X, and RPMs and source code files for
Linux/UNIX platforms are all available.

 

Installing MySQL on Linux/UNIX
The process of installing MySQL on Linux/UNIX is straightforward, whether you
use RPMs or install the binaries. If you are installing from RPMs, there are platformspecific
RPMs such as those for SuSE and generic Linux running on different
processor types, such as x86 32- and 64-bit.
For a minimal installation from RPMs, you need two files from the downloads page
at http://dev.mysql.com/downloads/mysql/5.5.html

MySQL-server-type-VERSIONNUMBER.PLATFORM.rpm—The MySQL server
. MySQL-client-type-VERSIONNUMBER.PLATFORM.rpm—The standard MySQL
client libraries
To perform a minimal installation from RPMs, type the following at your prompt:
# rpm -i MySQL-server-VERSION.i386.rpm MySQL-client-VERSION.i386.rpm

Another painless (and very common) installation method is to install MySQL from a
binary distribution. This method requires the gunzip and tar utilities to uncompress
and unpack the distribution, and also requires the ability to create groups and users
on the system. The first series of commands in the binary distribution installation
process has you adding a group and a user and unpacking the distribution, as follows:
# groupadd mysql
# useradd –r -g mysql mysql
# cd /usr/local
# tar zxvf /path/to/mysql-VERSION-PLATFORM.tar.gz

Next, the instructions tell you to create a symbolic link with a shorter name:
# ln -s mysql-VERSION-PLATFORM mysql
# cd mysql

After you unpack them, the README and INSTALL files walk you through the remainder
of the installation process for the version of MySQL you’ve chosen. In general,
the following series of commands are used:
# scripts/mysql_install_db –user=mysql
# chown -R root .
# chown -R mysql mysql_data
# chgrp -R mysql .
# bin/mysqld_safe –user=mysql &
You’re now ready to start the MySQL server, so skip ahead in this chapter to the
“Basic Security Guidelines” section to learn how to add passwords and users. If you
experienced any issues with your installation, check the “Troubleshooting Your
Installation” section.