MySQL Installation from Source
MySQL Installation
1. Remove any old packages if they exist and kill the processes.
#rpm -e MySQL-devel
#rpm -e MySQL-client
#rpm -e MySQL-server
#killall mysqld
2. Create your source file directory.
#mkdir /usr/local/src/mysql
#cd /usr/local/src/mysql
3. Download your source file into this directory.
4. After download complete.
#tar -zxvf mysql -*
#cd /usr/local/src/mysql/mysql-version
#groupadd mysql
#useradd -g mysql mysql
#pico conf_mysql
5. Now add the following to the conf_mysql file.
CFLAGS=”-03″
CXX=gcc
CXXFLAGS=”-03 -felide-constructors -fno-exceptions -fno-rtti”
./configure –prefix=/usr/local/mysql –with-extra-charsets=complex –enable-thread-safe-client –enable-local-infile –enable-assembler –disable-shared –with-client-ldflags=-all-static –with-mysqld-ldflags=-all-static
6. Change the permissions, run the file, and complete the installation. Then create the first test database, change the permission, and test the installation.
#chmod 755 conf_mysql
#./conf_mysql
#make
#make install
#scripts/mysql_install_db
#chown -R root /var/lib/mysql
#chown -R mysql /var/lib/mysql/var
#chgrp -R mysql /var/lib/mysql
#/var/lib/mysql/bin/mysqld_safe –user=mysql &
7. Don’t forget to set the root passwords.
#/var/lib/mysql/bin/mysqladmin -u root password ‘your-password’
#/var/lib/mysql/bin/mysqladmin -u root -h hostname-or-ipaddress password ‘your-password’
Done for MySQL installation.
You can start the MySQL daemon with:
#cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &
You can test the MySQL daemon with the benchmarks in the ’sql-bench’ directory:
#cd sql-bench ; perl run-all-tests
[Add user permission]
grant all privileges on *.* to ‘aaa’@'localhost’ identified by ‘aaaaaa’ with grant option;
grant select,insert,update,delete,create,drop on db_name.* to ‘user’@'hostname’ identified by ‘password’;
grant select,insert,update,delete,create,drop on db_name.* to ‘user’@'%’ identified by ‘password’; >>>>>Use % for hostname you can connect from all client host.
[Delete user from record]
revoke all privileges on *.* from ‘aaa’@'localhost’;
revoke grant option on *.* from ‘aaa’@'localhost’;
delete from mysql.user where user=’aaa’;
flush privileges;
Complete for MySQL Installing.

















