mysql 5.6 升级5.7

来源:互联网 发布:手机破解软件网站大全 编辑:程序博客网 时间:2024/05/23 13:33
注意:是一个很好的实践在安装新的软件前备份你的数据库,尽管MySQL 很努力的确保高级别的质量,通过备份来保护你的数据。升级5.6到5.7,Mysql 推荐你执行一个2进制的替换升级 使用下面的过程;1.停止老的(MySQL 5.6)server2.升级MySQL 2进制的或者包代替(代替5.6的2进制)3. 启动MySQL 5.7 使用存在的数据目录4. 运行mysql_update来升级系统表和初始化用于5.7使用另一种方法是使用本程序执行逻辑升级1.备份当前数据:shell> mysqldump --all-databases --routines --events --add-drop-table --flush-privileges=0 > data-for-upgrade.sql2.停止老的(MySQL 5.6)server3.安装MySQL 5.74.初始化一个新的数据目录v-lhb-db03:/data5.7/mysql# mysqld --initialize --datadir=/data5.7/mysql/5. 启动MySQL 使用新的数据目录运行mysql_upgrate 来升级系统表和初始化1.备份数据库2.备份5.6版本的软件v-lhb-db03:/usr/local# tar -cvf mysql.tar mysql/删除软件目录rm -rf mysql3.安装5.7的版本v-lhb-db03:/root/mysql-5.7.7-rc# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-- Running cmake version 2.8.12.2-- Could NOT find Git (missing:  GIT_EXECUTABLE) -- Configuring with MAX_INDEXES = 64U-- SIZEOF_VOIDP 8-- MySQL 5.7.7-rc-- Packaging as: mysql-5.7.7-rc-Linux-x86_64-- Looked for boost/version.hpp in  and -- BOOST_INCLUDE_DIR BOOST_INCLUDE_DIR-NOTFOUND-- LOCAL_BOOST_DIR -- LOCAL_BOOST_ZIP -- Could not find (the correct version of) boost.-- MySQL currently requires boost_1_57_0CMake Error at cmake/boost.cmake:76 (MESSAGE):  You can download it with -DDOWNLOAD_BOOST=1 -DWITH_BOOST=<directory>  This CMake script will look for boost in <directory>.  If it is not there,  it will download and unpack it (in that directory) for you.  If you are inside a firewall, you may need to use an http proxy:  export http_proxy=http://example.com:80Call Stack (most recent call first):  cmake/boost.cmake:228 (COULD_NOT_FIND_BOOST)  CMakeLists.txt:452 (INCLUDE)-- Configuring incomplete, errors occurred!See also "/root/mysql-5.7.7-rc/CMakeFiles/CMakeOutput.log".执行直接升级在多余一个的主要版本间(比如 MySQL 5.5 到5.7)。是不推荐和支持的如果你需要这么做,我们推荐你用2进制升级代替 比如5.5升级到5.71.升级Mysql 从5.5升级到5.62.用5.6启动 使用存在的数据目录3.运行mysql_upgrade 来升级系统表和初始化4.升级MYSQL 从5.6到5.75.启动5.7用现在存在的目录6.运行mysql_upgrade通常,通过下面的步骤从5.6升级到5.7阅读所有的细节来确认任何的影响会影响你的应用项目的改变列表在这个章节可以使你确定升级该注意的一些不兼容的讨论需要你注意在升级前。其他需要升级后处理MySQL 5.7 版本描述了显著的新的特性你可以在5.7版本中使用,变化标记为已知的问题或者不兼容的改变是和早期版本不兼容的,在升级前需要注意。我们的目标是避免那些改变,但是偶尔的 它们需要收集问题,比不兼容更坏的情况If you plan to to upgrade using the data directory from your existing MySQL installation:Stop the old (MySQL 5.6) serverUpgrade the MySQL binaries in place (replace the old binaries with the new ones)Start the MySQL 5.7 server normally (no special options)Run mysql_upgrade to upgrade the system tablesRestart the MySQL 5.7 server-------------------------------------------------------------------------------------------1.备份数据库2.备份5.6版本的软件v-lhb-db03:/usr/local# tar -cvf mysql.tar mysql/删除软件目录rm -rf mysql3.安装5.7的版本v-lhb-db03:/root/mysql-5.7.7-rc# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-- Running cmake version 2.8.12.2-- Could NOT find Git (missing:  GIT_EXECUTABLE) -- Configuring with MAX_INDEXES = 64U-- SIZEOF_VOIDP 8-- MySQL 5.7.7-rc-- Packaging as: mysql-5.7.7-rc-Linux-x86_64-- Looked for boost/version.hpp in  and -- BOOST_INCLUDE_DIR BOOST_INCLUDE_DIR-NOTFOUND-- LOCAL_BOOST_DIR -- LOCAL_BOOST_ZIP -- Could not find (the correct version of) boost.-- MySQL currently requires boost_1_57_0CMake Error at cmake/boost.cmake:76 (MESSAGE):  You can download it with -DDOWNLOAD_BOOST=1 -DWITH_BOOST=<directory>  This CMake script will look for boost in <directory>.  If it is not there,  it will download and unpack it (in that directory) for you.  If you are inside a firewall, you may need to use an http proxy:  export http_proxy=http://example.com:80Call Stack (most recent call first):  cmake/boost.cmake:228 (COULD_NOT_FIND_BOOST)  CMakeLists.txt:452 (INCLUDE)-- Configuring incomplete, errors occurred!See also "/root/mysql-5.7.7-rc/CMakeFiles/CMakeOutput.log".解决:  从MySQL 5.7.5开始Boost库是必需的,下载Boost库并上传到/usr/local/src下,在解压后复制到/usr/local/boost目录下,然后重新cmake并在后面的选项中加上选项-DWITH_BOOST=/usr/local/boost(下载:http://sourceforge.net/projects/boost/files/boost/)需要  Boost minor version found is 58 we need 57,安装boost_1_57_0.tar.gzv-lhb-db03:/root/boost_1_57_0# mv * /usr/local/boost/cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql  -DWITH_BOOST=/usr/local/boost make && make installchown -R mysql:mysql /usr/local/mysqlzjzc-mysql:/usr/local/mysql# mysql_upgrade  -uroot -p1234567^Czjzc-mysql:/usr/local/mysql# service mysql startStarting MySQL....                                         [  OK  ]zjzc-mysql:/usr/local/mysql# mysql_upgrade -uroot -p1234567升级完成后,查看版本:Server version:5.7.7-rc-log Source distribution

0 0