源码安装 mysql 5.5.20升级到mysql 5.6.25

环境:

centos 6.5  64

mysql 5.5.20 升级 5.6.25


mysql 5.5.20安装参考:

http://blog.csdn.net/u010098331/article/details/50730391

mysql 5.6.25安装参考:

     http://blog.csdn.net/u010098331/article/details/50886619


CentOS系统下将MySQL升级至5.6.25 (源码安装方式)

摘要:CentOS系统下将MySQL升级至5.6.25 (源码安装方式) ...

CentOS系统下将MySQL升级至5.6.10 (源码安装方式) 
进入MySQL  mysql> show variables like '%datadir%'; 
原MySQL 数据库 目录/var/lib/ mysql /   
# yum -y install cmake  #mysql5.5以后采用cmake方式,替换了原有的./configure 
#wget http://dev. mysql .com/get/Downloads/MySQL-5.6/ 
mysql -5.6.10.tar.gz/from/http://cdn. mysql .com 
# tar -zxvf mysql-5.6.10.tar.gz  
# cd mysql-5.6.10 
#cmake -DCMAKE_INSTALL_PREFIX= /usr/local/mysql #MySQL安装目录 
-DMYSQL_DATADIR= /usr/local/mysql/data #MySQL数据库目录  
-DDEFAULT_CHARSET=utf8  #默认字符集编码 
-DEXTRA_CHARSETS=all #扩展字符支持 
-DDEFAULT_COLLATION=utf8_general_ci #指定服务器默认的校对规则 
-DWITH_INNOBASE_STORAGE_ENGINE=1 #开启INNOBASE引擎 
-DWITH_ARCHIVE_STORAGE_ENGINE=1 #开启ARCHIVE引擎 
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1  #开启PERFSCHEMA引擎 
-DWITH_PARTITION_STORAGE_ENGINE=1 #开启分区引擎 

#make && make install 
#service  mysql d stop  #停掉原有MySQL服务 
#cp /usr/local/ mysql /support-files/my-default.cnf \  
/etc/my.cnf  #覆盖原有的my.cnf 

# vi /etc/my.cnf   #加入并修改以下 
basedir = /usr/local/ mysql  # 数据库 安装目录 
datadir = /var/lib/ mysql  #原 数据库 数据目录 
skip-grant-tables #由于升级需要,跳过权限验证 
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 中 
#去掉STRICT_TRANS_TABLES,禁用数据严格模式 

#cp /usr/local/ mysql /support-files/ mysql .server \ 
/etc/init.d/ mysql d #覆盖 mysql d服务 

#service  mysql d start #重启新版本MySQL 
#/usr/local/ mysql /bin/ mysql _upgrade  -uroot -p原数据库密码 #执行表权限升级
报错请参考:
  http://blog.csdn.net/u010098331/article/details/50888362

#/usr/local/
mysql /bin/ mysql check --all-databases -p密码 #检查所有 数据库  
#vi /etc/my.cnf  #去掉skip-grant-tables  
#service  mysql d restart # 数据库 升级成功 

以上步骤,本人已在生产环境中测试通过。。      
       
编译参数可参照MySQL官方文档: 
http://dev. mysql .com/doc/refman/5.6/en/source-configuration-options.html#option_cmake_storage_engine_options       
参考:
http://www.php1.cn/Content/CentOS_XiTongXiaJiang_MySQL_ShengJiZhi_5-6-10_YuanMaAnZhuangFangShi.html
http://xiedexu.cn/mysql-5-5-upgrade-to-mysql-5-6.htm
http://blog.sina.com.cn/s/blog_4c197d4201017raf.html
http://www.eziep.net/details/1.htm

猜你喜欢

转载自blog.csdn.net/demonson/article/details/80894587