看完INSTALL-SOURCE后记录下mysql 5.5安装的记录
cmake需要单独安装
myisam引擎默认加载,with_engine_storage_engine 加载innodb等引擎
datadir=/data/mysql
groupadd mysql
useradd -g mysql mysql -M
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DSYSCONFDIR=/etc -DMYSQL_DATADIR=/data/mysql/ -DWITH_engine_STORAGE_ENGINE=1 -DDEFAULT_CHARSET=utf8 -DWITH_EXTRA_CHARSETS=all -DENABLED_LOCAL_INFILE=1  -DDEFAULT_COLLATION=utf8_general_ci
make
make install
chown -R mysql:mysql /data/mysql
初始化时指定datadir basedir
/usr/local/mysql/scripts/mysql_install_db --user=mysql --datadir=/data/mysql/  --basedir=/usr/local/mysql/
cp support-files/my-huge.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/
修改
socket          = /data/mysql/mysql.sock
datadir         = /data/mysql
启动
/usr/local/mysql/bin/mysqld_safe  --user=mysql &
/etc/init.d/mysql.server start|stop