Upgrade MySQL Database from 5.5 to 5.6 on OSX 10.8 Mountan Lion

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
云数据库 RDS MySQL Serverless,价值2615元额度,1个月
简介:

MySQL version 5.6.14 is available for download for OSX, a double click and install is available named Mac OS X ver. 10.7 (x86, 64-bit), DMG Archive(Don’t worry about the 10.7 naming, Works fine in OSX 10.9 and OSX 10.8)

Stop the MySQL Server

sudo /usr/local/mysql/support-files/mysql.server stop

Download and Launch the DMG

There is no upgrade option in the installer and you are presented with the 3 installations:

mysql-update-osx

You need to install all the three installers.

Control/Right click the mysql-5.6…pkg to avoid the security GateKeeper. Follow the installation processes.

Location of MySQL 5.6 Data

MySQL data and files will be stored at:

/usr/local/mysql-5.6.14-osx10.7-x86_64

and an ‘mysql’ directory alias is also created that points to the same location

/usr/local/mysql

which points to

mysql -> mysql-5.6.14-osx10.7-x86_64

Your previous installation is maintained and will be filed in the same location with the appropraite version you were using, like so:

/usr/local/mysql-5.5.13-osx10.6-x86_6

What needs to be done is to migrate the database and tables to the new version.

Migrate Databases

The key directory from the previous instance that needs to be copied is :

/usr/local/mysql-5.5.13-osx10.6-x86_64/data

So in this instance the previous mysql version was 5.5.13 – rename the new data directory and copy in the old one and fix file ownership to MySQL:

Change Name of newer data directory
sudo mv /usr/local/mysql-5.6.14-osx10.7-x86_64/data /usr/local/mysql-5.6.14-osx10.7-x86_64/dataold
Copy Old Databases into new location
sudo cp -rf /usr/local/mysql-5.5.13-osx10.6-x86_64/data /usr/local/mysql-5.6.14-osx10.7-x86_64/
Set Correct Ownership to MySQL
sudo chown -R _mysql /usr/local/mysql-5.6.14-osx10.7-x86_64/data

Start MySQL and Repair

Now we need to start the MySQL database and run a repair/upgrade tool on the older databases

sudo /usr/local/mysql/support-files/mysql.server start
Run the Upgrade Tool
/usr/local/mysql/bin/mysql_upgrade

If you get errors on the first run, run the command again

Restart MySQL
sudo /usr/local/mysql/support-files/mysql.server restart
Check the Version
/usr/local/mysql/bin/mysql
Set MySQL Password
/usr/local/mysql/bin/mysqladmin -u root password 'yourpasswordhere'
my.cnf

In the latest version of MySQL 5.6 there is a default ‘my.cnf’ file that the database references that is now stored in:

/usr/local/mysql-5.6.14-osx10.7-x86_64/my.cnf

So if you have made any customisations to the behaviour of MySQL then these will now need to be added in the new my.cnf file and make a copy to /etc so any global changes will be read in when MySQL is launched.










本文转自 h2appy  51CTO博客,原文链接:http://blog.51cto.com/h2appy/1363989,如需转载请自行联系原作者
相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
3月前
|
存储 容灾 安全
在阿里云RDS(Relational Database Service)迁移前准备目标区域选择
在阿里云RDS(Relational Database Service)迁移前准备目标区域选择
29 3
|
3月前
|
存储 关系型数据库 数据库
进行RDS(Relational Database Service)迁移时,资源需求分析
进行RDS(Relational Database Service)迁移时,资源需求分析
31 3
|
3月前
|
SQL 运维 关系型数据库
在阿里云RDS(Relational Database Service)进行跨区域迁移
在阿里云RDS(Relational Database Service)进行跨区域迁移
42 2
|
3月前
|
存储 运维 容灾
在规划阿里云RDS(Relational Database Service)跨区迁移
在规划阿里云RDS(Relational Database Service)跨区迁移
41 1
|
3月前
|
存储 监控 关系型数据库
在规划和准备阿里云RDS(Relational Database Service)跨区域迁移
在规划和准备阿里云RDS(Relational Database Service)跨区域迁移
21 1
|
5月前
|
SQL Oracle 关系型数据库
MySQL必知必会:MySQL中的Schema与DataBase
MySQL必知必会:MySQL中的Schema与DataBase
|
3月前
|
存储 关系型数据库 数据库
在进行RDS(Amazon Relational Database Service,亚马逊关系数据库服务)迁移时,兼容性审查
在进行RDS(Amazon Relational Database Service,亚马逊关系数据库服务)迁移时,兼容性审查
23 1
|
3月前
|
SQL 存储 关系型数据库
MySQL技能完整学习列表——1、数据库基础概念——1、关系型数据库(Relational Database)
MySQL技能完整学习列表——1、数据库基础概念——1、关系型数据库(Relational Database)
182 0
|
3月前
|
存储 关系型数据库 数据库
RDS(Relational Database Service)性能瓶颈
RDS(Relational Database Service)性能瓶颈
30 4
|
4月前
|
SQL 存储 关系型数据库
RDS(Relational Database Service)性能瓶颈
RDS(Relational Database Service)性能瓶颈
27 4