MySQL is a small, fast and highly configurable DBMS. It supports a number of different table fileformats and different engines
MySQL is not ACID compliant except for innodb engines.
To connect to remote mysql database mysql has different engine called as federated engine.
The different tools available in mysql are as follows:
mysqld - MySQL server daemon
safe_mysqld - Server process monitor
mysqlaccess - Tool for creating MySQL users
mysqladmin - Utility for mysql administering
mysqldump - This tool is used to take the backup of mysqldatabases
mysql - Command line interface to connect to MySQL
mysqlshow - List all MySQL database and the count
For installing mysql on linux machines we can install mysql in three different ways.
Of all the three methods "RPM Installation" is the easiest method
1.) Binary Installation
2.) source distribution
3.) RPM Installation
A.) steps for intalling Binary Installation.
1.) create mysql user and group.
# groupadd mysql
# useradd -g mysql mysql
# cd /usr
2. download the mysql
http://dev.mysql.com/downloads/mysql/5.1.html
3.) Then unzip the file
# gunzip < /usr/mysql-VERSION.tar.gz | tar xvf -
# ln -s full-path-to-mysql-VERSION mysql
# cd mysql
# scripts/mysql_install_db
# chown -R root .
# chown -R mysql data
# chgrp -R mysql .
# bin/mysqld_safe --user=mysql &
B.) steps for intalling Source distribution.
1.) create mysql user and group.
# groupadd mysql
# useradd -g mysql mysql
2. download the mysql
http://dev.mysql.com/downloads/mysql/5.1.html
3. unzip the file
gunzip < mysql-5.0.45.tar.gz | tar -xvf -
4. let say it is under folder (/data01/sources/mysql-5.0.45/)
cd /data01/sources/mysql-5.0.45/
To check options to configure, see
./configure --help
For older versions, enabling federated,
./configure --prefix=/data01/lamp/mysql --enable-thread-safe-client --with-federated-storage-engine
For latest versions, enabling federated is as below
./configure --prefix=/data01/lamp/mysql --enable-thread-safe-client –with-plugins=innobase,myisam,federated
Make
Make install
Follow the below steps to configure mysql as service.
cp /data01/sources/mysql-5.0.45/support-files/my-huge.cnf /etc/my.cnf
cp /data01/sources/mysql-5.0.45/support-files/mysql.server /etc/rc.d/init.d/mysql
cd /etc/rc.d/init.d/
chmod 755 mysql
Installing database for the “mysql” User
cd /data01/lamp/mysql
chown -R mysql .
chgrp -R mysql .
bin/mysql_install_db --user=mysql
chown -R root .
chown -R mysql var
bin/mysqld_safe --user=mysql &
To Configure mysql as service, follow the below steps
cd /usr/bin/
ln -s /data01/lamp/mysql/bin/mysql .
ln -s /data01/lamp/mysql/bin/mysql_config .
ln -s /data01/lamp/mysql/bin/mysqldump .
ln -sf -s /data01/lamp/mysql/bin/mysql .
cd /usr/lib/
ln -sf /data01/lamp/mysql/lib/mysql/lib* .
cd /usr/include/
mkdir mysql
cd /usr/include/mysql/
ln -sf /data01/lamp/mysql/include/mysql/* .
C.) steps for intalling using "RPM" Installation.
1.) create mysql user and group.
# groupadd mysql
# useradd -g mysql mysql
2. download the mysql
http://dev.mysql.com/downloads/mysql/5.1.html
3.) Let say you have donwloaded the following RPM (mysql-5.5.11 version).
MySQL-client-5.5.11-1.linux2.6.x86_64.rpm
MySQL-devel-5.5.11-1.linux2.6.x86_64.rpm
MySQL-server-5.5.11-1.linux2.6.x86_64.rpm
MySQL-shared-5.5.12-1.linux2.6.x86_64.rpm
perl-DBD-MySQL-4.018-1.wc.x86_64.rpm
4.) Run the above RPM packages you have downloaded.
The command is as follows:
rpm -iUh MySQL-devel-5.5.11-1.linux2.6.x86_64.rpm
rpm -iUh MySQL-shared-5.5.12-1.linux2.6.x86_64.rpm
rpm -iUh MySQL-client-5.5.11-1.linux2.6.x86_64.rpm
rpm -iUh MySQL-server-5.5.11-1.linux2.6.x86_64.rpm
rpm -iUh perl-DBD-MySQL-4.018-1.wc.x86_64.rpm
5.) if we want to check the rpm pacages has installed correctly
rpm -qa | grep -i mysql
MySQL-shared-5.5.12-1.linux2.6
perl-DBD-MySQL-4.018-1.wc
MySQL-devel-5.5.11-1.linux2.6
MySQL-server-5.5.11-1.linux2.6
MySQL-client-5.5.11-1.linux2.6
6.) check wheather the mysql is instance is working or not
/etc/init.d/mysql status
7.) start the mysql instance if not started.
/etc/init.d/mysql start.
8.) check wheather my.cnf exists or not in /etc/my.cnf ( if not exists copy the my.cnf file and fine tune the parameters)
locate my-huge
/usr/share/doc/MySQL-server-5.5.11/my-huge.cnf
cp /usr/share/doc/MySQL-server-5.5.11/my-huge.cnf /etc/my.cnf
9.) if my.cnf parameters have changed restart the mysql server.
/etc/init.d/mysql restart
/etc/init.d/mysql status

No comments:
Post a Comment