`

安装mysql

阅读更多

 

安装mysql

shell> groupadd mysql

shell> useradd -g mysql mysql

shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -

shell> cd mysql-VERSION

shell> ./configure --prefix=/usr/local/mysql

shell> make

shell> make install

shell> scripts/mysql_install_db --user=mysql

shell> chown -R root  /usr/local/mysql

shell> chown -R mysql /usr/local/mysql/var

shell> chgrp -R mysql /usr/local/mysql

shell> cp support-files/my-medium.cnf /etc/my.cnf

shell> /usr/local/mysql/bin/mysqld_safe --user=mysql &

 

 

安装5.5版本

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql  -DMYSQL_DATADIR=/usr/local/mysql/data -DEXTRA_CHARSETS=all 

make

make install

 cp /home/lxu/mysql-5.5.20/support-files/my-huge.cnf /usr/local/mysql/my.cnf

vi /usr/local/mysql/my.cnf

chmod +w /usr/local/mysql

chown -R mysql:mysql /usr/local/mysql

cp /home/lxu/mysql-5.5.20/support-files/mysql.server /etc/init.d/mysql

chmod +x /etc/init.d/mysql

/sbin/chkconfig --add mysql

/sbin/chkconfig mysql on

 /usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql

/usr/local/mysql/bin/mysqld_safe --defaults-file=/usr/local/mysql/my.cnf &

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics