首先创建专用帐户:
[root@localhost zsdins]# groupadd mysql
[root@localhost zsdins]# useradd -r -g mysql mysql
安装cmake(mysql5.5要cmake才能编译)
tar zxvf cmake-2.6.4.tar.gz
./bootstrap
make
make install
安装mysql5.5
tar zxvf mysql-5.5.25.tar.gz
cd mysql-5.5.25
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql55 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DENABLED_LOCAL_INFILE=ON -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 -DWITHOUT_PARTITION_STORAGE_ENGINE=1 -DCOMPILATION_COMMENT="zsd edition" -DMYSQL_UNIX_ADDR=/data/mysqldata/3306/mysql.sock -DSYSCONFDIR=/data/mysqldata/3306 > /usr/local/mysql_setuplogs_make55.log 2>&1
make >/usr/local/mysql_setuplogs_make51.log 2>&1
make install >/usr/local/mysql_setuplogs_make51.log 2>&1
创建相关目录以及赋予相关的权限
cd /usr/local/
chown -R mysql:mysql mysql55
mkdir -p /data/mysqldata/3306
cd /data/mysqldata/3306
mkdir data binlog tmp innodb_ts innodb_log
chown -R mysql:mysql ./
创建mysql_install_db
/usr/local/mysql55/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql55 --datadir=/data/mysqldata/3306/data
vi /data/mysqldata/3306/my.cnf
启动mysql
/usr/local/mysql55/bin/mysqld_safe --defaults-file=/data/mysqldata/3306/my.cnf &
备注:2>&1 错误信息也会打印到log里
阅读(1672) | 评论(1) | 转发(1) |