linux enterprise 5下安装mysql 5.6

mysql从5.5之后安装开始用cmake安装,cmake是安装mysql5.5之后版本必不可少的工具。
安装cmake如下,从cmake官网下载源码安装包
  [root@localhost ~]# wget http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz
  [root@localhost ~]# tar zxvf  cmake-2.8.10.2.tar.gz
  [root@localhost ~]# cd cmake-2.8.10.2
  [root@localhost ~]# ./configure   
  [root@localhost ~]# make  && make install

cmake 安装成功,接下来安装mysql5.6.11
参考http://dev.mysql.com/doc/refman/5.6/en/source-configuration-options.html
解压mysql安装包
[root@localhost ~]#  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

[root@localhost ~]# 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/mysql/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 就安装完了

在5.6里有一个改变,那就是5.6里配置文件有了新改动,不像以前一样各种参数都有配置的样板,5.6里没有了,具体参见 下面官方链接

http://dev.mysqom/doc/refman/5.6/en/server-default-changes.html <http://dev.mysql.com/doc/refman/5.6/en/server-default-changes.html>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值