Sunday, July 1, 2012

mysql Installation on linux

Manualy create a text file named my.cnf with following cotents and place this in /etc


[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid


#########useradd -G {group-name} username if gp is not createed



if mysql is already install as default with centos installation then remove it

cd /var/lib/mysql
rm -rf *
rpm -qa | grep -i mysql
rpm -e





cd /var/run/

mkdir -p mysqld

chown -R mysql:mysql mysqld/

cd /tmp

chmod 777 *.rpm

rpm -Uvh *.rpm

cd /var/lib/mysql

mysql_install_db (this is require to to get the default databases with mysql i.e test and mysql)

/usr/bin/mysqld_safe & (this is required as to up the server)


tail -100f /var/log/mysqld.log (to make sure that mysqld works corectly)


service mysql status
service mysql stop

ps -ef | grep -i mysql
kill -9

ps -ef | grep -i mysql (to see the id of mysql)

service mysql restart

rpm -qa |grep -i mysql (to sse all the installed rpms)

No comments: