1. cd /opt/soft
2. 安装 make
wget http://ftp.gnu.org/gnu/make/make-3.82.tar.gz
tar zxvf make-3.82.tar.gz
cd make-3.82
./configure
make
make install
cd ..
3. 安装 bison
wget http://ftp.gnu.org/gnu/bison/bison-2.5.tar.gz
tar zxvf bison-2.5.tar.gz
cd bison-2.5
./configure
make
make install
cd ..
3. 安装libstdc++.so.6
yum install libstdc++.so.6
4. yum install gcc
5. 安装cmake
wget http://www.cmake.org/files/v2.8/cmake-2.8.11.2.tar.gz
tar zxvf cmake-2.8.11.2.tar.gz
cd cmake-2.8.11.2
./configure
make
make install
cd ..
6. 安装 ncurses
wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.8.tar.gz
tar zxvf ncurses-5.8.tar.gz
cd ncurses-5.8
./configure
make
make install
cd ..
7. 安装mysql
wget http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.34.tar.gz
groupadd mysql
useradd -r -g mysql mysql
tar zxvf mysql-5.5.34.tar.gz
cd mysql-5.5.34
cmake ./ -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DINSTALL_DATADIR=/usr/local/mysql/data
make
make install
cd /usr/local/mysql/
chown -R mysql .
chgrp -R mysql .
#注意备份my.cnf
cp support-files/my-medium.cnf /etc/my.cnf
scripts/mysql_install_db --user=mysql
修改root密码
./bin/mysql_secure_installation
如果启动出错
'./mysql-bin.index' not found (Errcode: 13) 的解决方法
/usr/local/mysql/libexec/mysqld: File './mysql-bin.index' not found (Errcode: 13)
020101 0:42:21 [ERROR] Aborting
020101 0:42:21 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
提示./mysql-bin.index无法找到(由于mysql开启了bin日志功能),到数据库根目录查看该文件是存在的,可能是文件权限的问题,查看了数据库根目录的权限是700,所有者和用户组都是root,可能是上次转移数据库的时候不小心修改了文件夹的权限。
解决方法:
chgrp -R mysql /usr/local/mysql/data && chown -R mysql /usr/local/mysql/data
重新启动mysql [OK]
/usr/local/mysql/libexec/mysqld: File './mysql-bin.index' not found (Errcode: 13)
020101 0:42:21 [ERROR] Aborting
020101 0:42:21 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
提示./mysql-bin.index无法找到(由于mysql开启了bin日志功能),到数据库根目录查看该文件是存在的,可能是文件权限的问题,查看了数据库根目录的权限是700,所有者和用户组都是root,可能是上次转移数据库的时候不小心修改了文件夹的权限。
解决方法:
chgrp -R mysql /usr/local/mysql/data && chown -R mysql /usr/local/mysql/data
重新启动mysql [OK]