心 涯

NET&JAVA&PHP(要跨界,你不只要跨「脑」的界限,更要跨越「心」的界限,不怕改变,不怕再学习!)

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

一、软件包

a) cmake-2.8.3.tar.gz

b) mysql-5.5.8.tar.gz

二、安装步骤

a) Tar zxvf cmake-2.8.3.tar.gz

b) Cd cmake-2.8.3

c) ./bootstrap

d) Make

e) Make install

f) Tar zxvf mysql-5.5.8.tar.gz

g) Cd mysql-5.5.8

h) 配置参数

cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql5 \

-DINSTALL_DATADIR=/usr/local/mysql5/data \

-DDEFAULT_CHARSET=utf8 \

-DDEFAULT_COLLATION=utf8_general_ci \

-DEXTRA_CHARSETS=all \

-DWITH_SSL=system \

-DWITH_EMBEDDED_SERVER=1 \

-DENABLED_LOCAL_INFILE=1 \

-DWITH_MYISAM_STORAGE_ENGINE=1

i) Make

j) Make install

k) Useradd mysql –d /dev/null –s /sbin/nologin

l) Chown –R mysql:mysql /usr/local/mysql5/

m) Chown –r mysql:mysql /usr/local/mysql5/data

n) Cp ./support-files/my-medium.cnf /etc/my.cnf

o) Chown 744 ./scripts/mysql_install_db

p) ./scripts/mysql_install_db –user=mysql –basedir=/usr/local/mysql5 –datadir=/usr/local/mysql5/data

q) Chown –R mysql:mysql /usr/local/mysql5/data

r) /usr/local/mysql5/bin/mysqld_safe –user=mysql&

s) /usr/local/mysql5/bin/mysql –uroot

t) Mysql>use mysql;

u) Mysql>update user set password=password(‘123456’) where user=’root’;

v) Cp ./support-files/mysql.server /etc/init.d/mysql5

w) Chkconfig –add mysql5

x) Chkconfig mysql5 on

y) Service mysql5 restart

三、附件

a) 编译选项说明

编译选项说明:

-DCMAKE_INSTALL_PREFIX=/usr/local/mysql5 //安装目录

-DINSTALL_DATADIR=/usr/local/mysql5/data //数据库存放目录

-DDEFAULT_CHARSET=utf8 //使用utf8字符

-DDEFAULT_COLLATION=utf8_general_ci //校验字符

-DEXTRA_CHARSETS=all //安装所有扩展字符集

-DWITH_SSL=system //使用SSL加密 (bundled)

-DWITH_EMBEDDED_SERVER=1 //编译成embedded mysql library

-DENABLED_LOCAL_INFILE=1 //允许从本地导入数据

-DWITH_MYISAM_STORAGE_ENGINE=1 //安装myisam引擎

b) Mysql>show engines;

+--------------------+---------+------------------------------------------------------------+--------------+------+------------+

| Engine | Support | Comment | Transactions | XA | Savepoints |

+--------------------+---------+------------------------------------------------------------+--------------+------+------------+

| InnoDB | DEFAULT | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |

| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |

| CSV | YES | CSV storage engine | NO | NO | NO |

| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |

| MyISAM | YES | MyISAM storage engine | NO | NO | NO |

| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |

+--------------------+---------+------------------------------------------------------------+--------------+------+------------+

6 rows in set (0.01 sec)

posted on 2011-01-04 13:18  witer666  阅读(745)  评论(0编辑  收藏  举报