标签:
1.安装前装备
1.1已经安装gcc(gcc-c++) make automake
1.2下载cmake:http://www.cmake.org/files/v2.8/cmake-2.8.8.tar.gz
1.3下载mysql:http://fossies.org/unix/misc/mysql-5.5.23.tar.gz/
1.4下载bison:http://ftp.gnu.org/gnu/bison/bison-2.5.tar.gz
2.安装cmake
tar zxvf cmake-2.8.8.tar.gz
cd cmake-2.8.8
./bootstrap
gmake
gmake install
3.安装bison
tar zxvf bison-2.5.tar.gz
cd bison-2.5
./configure
make
make install
4.安装mysql
默认编码设为gbk,字符集为gbk_chinese_ci
4.1添加mysql账户
/usr/sbin/groupadd mysql
/usr/sbin/useradd -g mysql mysql
4.2解压
tar xvf mysql-5.5.23.tar.gz
cd mysql-5.5.23/
4.3编译
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=gbk -DDEFAULT_COLLATION=gbk_chinese_ci -DWITH_EXTRA_CHARSETS:STRING=gbk,gb2312,utf8 -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/opt/mysql/data
make
make install
4.4增加权限
chmod +w /usr/local/mysql
chown -R mysql:mysql /usr/local/mysql
mkdir -p /opt/mysql/data/
mkdir -p /opt/mysql/log/
chown -R mysql:mysql /opt/mysql/
4.5拷贝my.cnf文件
cd support-files/
cp my-large.cnf /opt/mysql/my.cnf (注意:my-large.cnf适用于1G内存左右的服务器,可以根据自己配置情况选用my-large.cnf 或 my-huge.cnf 等不同配置)
cp mysql.server /etc/init.d/mysqld
5.初始化安装
/usr/local/mysql/scripts/mysql_install_db --defaults-file=/opt/mysql/my.cnf --basedir=/usr/local/mysql --datadir=/opt/mysql/data --user=mysql
6.将mysql加入开启启动
chmod +x /etc/init.d/mysqld
vi /etc/init.d/mysqld (如果有特殊目录,编辑此文件,比如基本目录,及数据目录)
basedir=/usr/local/mysql
datadir=/opt/mysql/data
chkconfig --add mysqld
chkconfig --level 345 mysqld on
7.启动mysql
service mysqld start
8.修改root密码
mysqladmin -u root password "newpwd"
9.安装中的其他问题
Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
缺少 ncurses-devel
用yum install ncurses-devel
标签:
原文地址:http://www.cnblogs.com/bwteacher/p/4789605.html