您的位置:首页 > 数据库 > MySQL

ubuntu server 12.04 安装 mysql5.7

2016-03-30 10:49 435 查看
再一次感受到,自己去摸索,没人带路,是件多么痛苦的事情,就因为这个简单的安装软件,我浪费了半个月,所以一定要分享一下。

因为原来用的mysql版本是5.5的,所以客户端发的表情无法保存,因为只有utf8mb4编码才可以保存,这个编码是utf8的扩展或超类吧,随你怎么想吧。只是mysql5.6以上的版本才支持utf8mb4这个编码,所以就要升级了。做为一个菜鸟,最常做的事就是百度跟google了,当然公司用的是VMware vShpere 了解这个鬼东西也用了好久。废话不多说了,试了n种方法以后,最后得到的结论就是官网上面最简单的方法。
http://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/
下面就是原文,简单的翻译就是:

先下载这个配置文件:mysql-apt-config_0.6.0-1_all.deb   地址:http://dev.mysql.com/downloads/repo/apt/

再通过这个命令安装:

sudo dpkg -i /路径/version-specific-package-name
.deb[/code]


然后会弹出个对话框,然后先把你要安装的版本,我现在下载的这个是可以安装5.6或5.7的。选好版本以后选择 APPLY 选项,然后再ok.

接下来就是:
shell> [code]sudo apt-get update
[/code]


当你做完这步之后,你再执行安装mysql命令,你安装的就是你选择的版本了。就是这么简单。

sudo apt-get install mysql

(如果 你不更新上面的apt包,你直接安装的就是5.5的版本,我也是个菜鸟,没有把原来的那个系统升级,直接重新弄一个然后再把数据导过来,因为项目还没上线)


Adding the MySQL APT Repository

First, add the MySQL APT repository to your system's software repository list. Follow these steps:

Go to the download page for the MySQL APT repository at http://dev.mysql.com/downloads/repo/apt/.

Select and download the release package for your platform.

Install the downloaded release package with the following command, replacing 
version-specific-package-name
 with
the name of the downloaded package (preceded by its path, if you are not running the command inside the folder where the package is):
shell> [code]sudo dpkg -i /PATH/version-specific-package-name
.deb
[/code]

For example, for version 
w.x.y-z
 of
the package, the command is:
shell> [code]sudo dpkg -i mysql-apt-config_w.x.y-z
_all.deb
[/code]

Note that the same package works on all supported Debian and Ubuntu platforms.

During the installation of the package, you will be asked to choose the versions of the MySQL server and other components (for example, the MySQL Workbench) that you want to install. If you are not sure which version to choose, do not change the default options
selected for you. You can also choose none if
you do not want a particular component to be installed. After making the choices for all components, choose Apply to
finish the configuration and installation of the release package.

You can always change your choices for the versions later; see Selecting
a Major Release Version for instructions.

Update package information from the MySQL APT repository with the following command (this
step is mandatory):
shell> [code]sudo apt-get update

[/code]

Instead of using the release package, you can also add and configure the MySQL APT repository manually; see Appendix
A: Adding and Configuring the MySQL APT Repository Manually for details.

Note

Once the MySQL APT repository is enabled on your system, you will no longer be able to install any MySQL packages from your platform's native software repositories until the MySQL APT repository is disabled.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  mysql ubuntu 编码