Chinaunix首页 | 论坛 | 博客
  • 博客访问: 269820
  • 博文数量: 42
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 534
  • 用 户 组: 普通用户
  • 注册时间: 2012-02-26 19:11
文章分类
文章存档

2014年(42)

我的朋友

分类: Mysql/postgreSQL

2014-06-07 14:06:44

需要安装Mysql5.5.8时,请参阅本文档。

安装Mysql5.5.8服务,提供公司CSFDP测试环境。正式环境也采用该版本的mysql

1.1.环境

PC机:IntelE5300 内存4G 硬盘500G

Mysql5.5.8

cmake2.8.3

2.1.安装cmake

shell>tar zxvf cmake-2.8.3.tar.gz

shell>cd cmake-2.8.3

shell>./configure

shell>make

shell>make install

2.2. 安装mysql

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/

3 mysql自动启动脚本

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

4 root密码

shell>/usr/local/mysql/bin/mysqladmin –u root password‘password’

阅读(2358) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~