linux enterprise 5下安装mysql 5.6
 
mysql从5.5之后安装开始用cmake安装,cmake是安装mysql5.5之后版本必不可少的工具。
安装cmake如下,从cmake官网安装包
  [[email protected] ~]# wget http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz
  [[email protected] ~]# tar zxvf  cmake-2.8.10.2.tar.gz
  [[email protected] ~]# cd cmake-2.8.10.2
  [[email protected] ~]# ./configure   
  [[email protected] ~]# make  && make install 
 
cmake 安装成功,接下来安装mysql5.6.11 
参考http://dev.mysql.com/doc/refman/5.6/en/source-configuration-options.html
解压mysql安装包 
[[email protected] ~]#  tar zxvf  mysql-5.6.11.tar.gz 
进入mysql解压后的目录  cd mysql-5.6.11,指定mysql放那个目录,--CMAKE_INSTALL_PREFIX=/usr/local/mysql5.6,指定mysql数据目录,--datadir=/usr/local/share/xxxxx
--
 
创建安装目录 mkdir /usr/local/mysql 
创建数据存放目录   mkdir  /usr/local/mysql/data 
 
[[email protected] ~]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci 
 
make  && make install  
 
修改 目录权限 
cd /usr/local/mysql 
chown -R  root:mysql .
chown -R mysql:mysql  data 
 
创建系统的表
 cd /usr/local//scripts 
./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
 
执行要加上 --basedir  --datadir 参数 ,否则报如下错误
FATAL ERROR: Could not find ./bin/my_print_defaults
 
If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.
 
If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.
 
cp support-files/my-default.cnf /etc/my.cnf 
 
加环境变量  
 
这样一个mysql 5.6 就安装完了