Mysql5.5安装
环境:centos5.6
[root@yznvm1 mysql-5.5.19]# uname -a
Linux yznvm1 2.6.18-238.el5 #1 SMP Thu Jan 13 15:51:15 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
Mysql5.5不同于之前版本,需要安装cmake
下载cmake
[root@yznvm1 yzn]# wget http://www.cmake.org/files/v2.8/cmake-2.8.7.tar.gz
安装cmake
[root@yznvm1 yzn]# tar xvf cmake-2.8.7.tar.gz
[root@yznvm1 cmake-2.8.7]# ./configure
[root@yznvm1 cmake-2.8.7]# make
[root@yznvm1 cmake-2.8.7]# make install
安装到这个目录下
/usr/local/share/cmake-2.8/
MySQL安装
下载:
[root@yznvm1 httpd-2.2.21]# wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.19.tar.gz/from/http://mysql.ntu.edu.tw/
[root@yznvm1 yzn]# tar zxvf mysql-5.5.19.tar.gz
[root@yznvm1 yzn]# cd mysql-5.5.19
[root@yznvm1 mysql-5.5.19]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DWITH_SSL=system -DWITH_EMBEDDED_SERVER=1 -DENABLED_LOCAL_INFILE=1 -DWITH_MYISAM_STORAGE_ENGINE=1
[root@yznvm1 mysql-5.5.19]# make && make install
安装目录是/usr/local/mysql
[root@yznvm1 home]# groupadd mysql
[root@yznvm1 home]# useradd -g mysql mysql
[root@yznvm1 home]# vi /root/.bash_profile
PATH=$PATH:/usr/local/mysql/bin
[root@yznvm1 mysql]# ./scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/var/lib/mysql --user=mysql
[root@yznvm1 home]# chown -R mysql.mysql .
[root@yznvm1 mysql]# chown -R mysql:mysql /var/lib/mysql
[root@yznvm1 mysql-5.5.19]# cp ./support-files/my-medium.cnf /etc/my.cnf
[root@yznvm1 mysql-5.5.19]# ./bin/mysqld_safe --user=mysql --data=/var/lib/mysql&
修改root口令
[root@yznvm1 mysql-5.5.19]# mysql -u root -h localhost
[root@yznvm1 mysql]# mysql -u root -h localhost
use mysql
update user set password=PASSWORD('123456') where user='root';
#cp support-files/mysql.server /etc/init.d/mysqld
#chkconfig --add mysqld
#chkconfig mysqld on