2014年2月11日 星期二

manual install mysql server

1. update and install some package need to install mysql
# apt-get update
# apt-get install fakeroot build-essential dpkg-dev libaio-dev

2. download mysql compress file from mysql site and decompress it
# tar zxvf mysql-advanced-5.5.28-linux2.6-x86_64.tar.gz

3. move it to /usr/local and create software link for mysql
# mv mysql-advanced-5.5.28 /usr/local/
# cd /usr/local
# ln -s mysql-advanced-5.5.28 mysql

4.create mysql user and group
# adduser -d /home/mysql -m mysql

5. change file owner and install mysql
# chown -R mysql /usr/local/mysql
# chown -R mysql /usr/local/mysql

6.install mysql server
#/usr/local/mysql/bin/mysql_install_db --basedir=/usr/local/mysql --datadir=/var/lib/mysql --user=mysql

7.copy mysql configure to /etc/
#cp suuport-files/my-medium.cnf /etc/my.cnf

8.start mysql server
#/usr/local/mysql/bin/mysql_safe --user=mysql &

9. add mysql search path to default environment
# vim /etc/environments
add /usr/local/mysql/bin to the end of the line

10. cp mysql script to /etc/init.d/
# cp support-file/mysql.server /etc/mysql.server

11. login mysql and change root password
#mysql -u root

grant all on *.* to 'root'@'localhost' identified by 'xxxxx'
flush privileges

12. restart mysql to confirm the password for rooot
# /etc/init.d/mysql.server restart

沒有留言:

張貼留言