2014年(42)
分类: Mysql/postgreSQL
2014-06-07 14:06:44
安装Mysql5.5.8服务,提供公司CSFDP测试环境。正式环境也采用该版本的mysql
PC机:IntelE5300 内存4G 硬盘500G
Mysql5.5.8
cmake2.8.3
shell>tar zxvf cmake-2.8.3.tar.gz
shell>cd cmake-2.8.3
shell>./configure
shell>make
shell>make install
shell>tar zxvf mysql-5.5.8.tar.gz
shell>cd mysql-5.5.8
shell>cmake . \
-DCMAKE_INSTALL_PREFIX:PATH=/usr/local/mysql \
-DCOMMUNITY_BUILD:BOOL=ON \
-DENABLED_PROFILING:BOOL=ON \
-DENABLE_DEBUG_SYNC:BOOL=OFF \
-DINSTALL_LAYOUT:STRING=STANDALONE \
-DMYSQL_DATADIR:PATH=/usr/local/mysql/data \
-DMYSQL_MAINTAINER_MODE:BOOL=OFF \
-DWITH_EMBEDDED_SERVER:BOOL=ON \
-DWITH_EXTRA_CHARSETS:STRING=all \
-DWITH_SSL:STRING=bundled \
-DWITH_UNIT_TESTS:BOOL=OFF \
-DWITH_ZLIB:STRING=bundled \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_COMMENT=dancebear \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-LH
shell>make && make install
shell>groupadd mysql
shell>useradd -g mysql mysql
shell>mkdir /usr/local/mysql/conf
shell>mkdir /usr/local/mysql/var
shell>cd /usr/local/mysql
shell>cp support-files/my-huge.cnf conf/my.cnf
shell>chown -R root:mysql /usr/local/mysql
shell>/usr/local/mysql/scripts/mysql_install_db--basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --skip-name-resolve--user=mysql --defaults-file=/usr/local/mysql/conf/my.cnf--pid-file=/usr/local/mysql/var/mysql.pid--socket=/usr/local/mysql/var/mysql.sock
shell>ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql
shell>ln -s /usr/local/mysql/bin/mysqladmin /usr/bin/
shell>ln -s /usr/local/mysql/bin/mysqld_safe /usr/bin/
shell>ln -s /usr/local/mysql/share/mysql/mysql.server/usr/bin/
shell>ln -s /usr/local/mysql/bin/mysqldump /usr/bin/
shell>cp /usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld
shell>chmod 755 /etc/init.d/mysqld
shell>chkconfig –-add mysqld
shell>chkconfig –-level 345 mysqld on
修改配置文件/etc/init.d/mysqld,添加安装mysql的路径
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
可以使用以下命令启停mysql服务或查看当前mysql服务状态
shell>/etc/init.d/mysqld start
shell>/etc/init.d/mysqld stop
shell>/etc/init.d/mysqld status
shell>/usr/local/mysql/bin/mysqladmin –u root password‘password’