漫漫长路,其修远兮!
分类: Mysql/postgreSQL
2013-03-05 12:14:08
好久没有安装mysql了,今天装了下,还有点不流畅,把详细的安装的流程写下来~,后续把mysql日常操作都写成checklist
1.创建mysql组和mysql用户
groupadd mysql
useradd -g mysql mysql
2.创建相关的目录(根据自己的规则设置目录)
mkdir
/data/dbdata
/usr/local/mysql
/usr/local/mysql/tmp
或者(推荐使用下面的)
mkdir
/data/dbdata/mysqldata ---表结构文档,ibdata,logfie,errlog,
/data/dbdata/mysqllog --主要包括binlog目录,slow-log,relay-log目录
/data/dbdata/mysqllog/binlog --存放binlog
/data/dbdata/mysqllog/relay-log
3.更改目录的owner,group
chown -R mysql /data/dbdata /usr/local/mysql /usr/local/mysql/tmp
chgrp -R mysql /data/dbdata /usr/local/mysql /usr/local/mysql/tmp
4.安装cmake
5.编译配置
点击(此处)折叠或打开
./configure |
Cmake . |
解释说明 |
--prefix |
-DCMAKE_INSTALL_PREFIX |
指定安装目录,默认安装在/usr/local |
--with-extra-charsets |
-DEXTRA_CHARSETS |
Use charsets in addition to default (none, complex,all, or a list selected from the above sets) |
--enable-assembler |
none |
允许使用汇编模式(优化性能) |
--with-charset |
-DDEFAULT_CHARSET |
Default character set |
--enable-thread-safe-client |
none |
以线程方式端编译客户端,如果是 all-static,静态链接可以提高性能 |
--with-big-tables |
none |
Support tables with more than 4 G rows even on 32 bit platforms |
--with-readline |
-DWITH_READLIN=1 |
--Use system readline instead of bundled copy |
--with-ssl |
-DWITH_SSL=system |
Include SSL support |
--enable-local-infile |
DENABLED_LOCAL_INFILE=1 |
Enable LOAD DATA LOCAL INFILE (default: disabled) |
--with-plugins |
archive,blackhole在cmake中没有直接对应的相同选项。对于csv,myisam,myisammrg,heap在cmake中是不需要明确指定存储引擎的名称,因为它们是强制性安装。可以使用以下选择来安装innodb,archive,blackhole存储引擎 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -WIHTOUT_PARTITION_STORAGE_ENGINE=1 |
Available configurations are: none max max-no-ndb all. Mysql5.1开始,编译添加innodb插件就从--with-innodb改成了--with-plugins=innobase,如果多个插件,可以写成:-with-plugins=partition,blackhole,heap,innobase,myisam,ndbcluster用逗号分开 |
--localstatedir |
-DMYSQL_DATADIR |
数据的目录,缺省会在安装目录下的var目录 |