日期:2014-05-16 浏览次数:20811 次
环境:Oracle Linux 6(64 bit)
下载mysql: http://dev.mysql.com/downloads/mysql/5.1.html 版本:5.5.36 平台:Source Code
Generic Linux (Architecture Independent), Compressed TAR Archive(mysql-5.5.36.tar.gz) 下载20.7M的这个包
接下来用cmake来安装mysql,安装之前先确保已安装cmake:rpm -qa|grep cmake,并卸载旧版本的mysql
tar -xzvf mysql-5.5.36.tar.gz创建安装目录
cd /u02 mkdir mysql mkdir mysql/data chmod -R 755 mysql-5.5.36 chmod -R 755 mysql
cd /u02/mysql-5.5.36 cmake -DCMAKE_INSTALL_PREFIX=/u02/mysql && make && make install
scripts/mysql_install_db \
--basedir=/u02/mysql \
--datadir=/u02/mysql/data \
--user=grid
cmake时的其他参数:
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS:STRING=utf8,gbk \
-DWITH_MYISAM_STORAGE_ENGINE=1 \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \ -DENABLED_LOCAL_INFILE=1 \ -DMYSQL_DATADIR=/var/mysql/data
cp support-files/my-medium.cnf /u02/mysql/my.cnf chown -R grid:grid /u02/mysql
[mysqld] basedir = /u02/mysql datadir = /u02/mysql/data log-error = /u02/mysql/mysql_error.log pid-file = /u02/mysql/mysql.pid user = grid tmpdir = /tmp
bin/mysqld_safe --user=grid &
cd /u02/mysql/support-files cp ./mysql.server /etc/init.d/mysqld /etc/init.d/mysqld start chmod +x /etc/init.d/mysqld
basedir=/usr/local/mysql datadir=/var/mysql/data
chkconfig --list mysqld chkconfig --add mysqld chkconfig --level 345 mysqld on
vi /etc/profile export PATH=$PATH:/u02/mysql/bin source /etc/profile