分类: LINUX
2012-01-07 14:44:07
MySQL 5.5使用InnoDB作为默认的数据库存储引擎
下载:
1. 建mysql用户
groupadd mysql |
2. mysql 5.5需要用cmake来编译:
安装cmake,及相关包:
yum install -y \
|
3. 解压 mysql5.5.tar.gz ,编译:
cmake \
|
然后执行:
Make && make install |
如果想重新make,需清除cmake用:
make clean
|
4. 设置:
cp support-files/my-medium.cnf /etc/my.cnf |
5. 添加相对路径:
echo " export PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile |
6. 启动和停止Mysql:
mysql.server start |
7. 查看是否有3306端口:
netstat -anp | grep LISTEN |
8. 编辑 /etc/my.cnf,添加红色字体:
[client] [mysqld] log-bin=mysql-bin |
9. 进入 Mysql
mysql mysql> status; -------------- mysql Ver 14.14 Distrib 5.5.21, for Linux (x86_64) using EditLine wrapper Connection id: 2 Current database: Current user: root@localhost SSL: Not in use Current pager: stdout Using outfile: '' Using delimiter: ; Server version: 5.5.21-log Source distribution Protocol version: 10 Connection: Localhost via UNIX socket Server characterset: utf8 UNIX socket: /usr/local/mysql/mysql.sock Uptime: 26 min 45 sec
|
10. Mysql常用命令: