简体   繁体   English

如何在 Ubuntu 14.04 上安装 MySQL 5.6.23

[英]How to install MySQL 5.6.23 on Ubuntu 14.04

I am trying to install MySQL 5.6.23, but it seems it is not an easy path.我正在尝试安装 MySQL 5.6.23,但这似乎不是一条简单的路径。

I had Mysql 5.5 on Ubuntu 14.04 in a VM.我在虚拟机中的 Ubuntu 14.04 上安装了 Mysql 5.5。

I ran, sudo apt-get install mysql-server-5.6 .我跑了, sudo apt-get install mysql-server-5.6 Mysql 5.6.19 got installed, but how do I update it to 5.6.23? Mysql 5.6.19 已安装,但如何将其更新到 5.6.23?

The Mysql site also does not provide the download link! Mysql站点也没有提供下载链接!

Add a repo添加回购

echo "deb http://repo.mysql.com/apt/ubuntu/ precise mysql-apt-config
deb http://repo.mysql.com/apt/ubuntu/ precise mysql-5.6" | sudo tee /etc/apt/sources.list.d/mysql.list

curl -s http://ronaldbradford.com/mysql/mysql.gpg | sudo apt-key add -

sudo apt-get update

sudo apt-get install mysql-server-5.6

You can get other versions apart from the current recommended ones from the archive:除了当前推荐的版本之外,您还可以从存档中获取其他版本:

http://downloads.mysql.com/archives/community/ http://downloads.mysql.com/archives/community/

They're tar archives though so will need more active management and configuration than .deb files.它们是 tar 存档,因此需要比 .deb 文件更积极的管理和配置。 But at least you can run specific older versions.但至少您可以运行特定的旧版本。

It's been a while since I ran a version from there and I don't remember if source is included.自从我从那里运行一个版本已经有一段时间了,我不记得是否包含源代码。 If it is, you might be able to use the source and a src deb (replace the source from the src deb) and build a deb for yourself.如果是,您也许可以使用源代码和 src deb(替换 src deb 中的源代码)并为自己构建一个 deb。

To install MySQL, open terminal and type in these commands:要安装 MySQL,请打开终端并输入以下命令:

sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql

During the installation, MySQL will ask you to set a root password.在安装过程中,MySQL 会要求您设置 root 密码。 If you miss the chance to set the password while the program is installing, it is very easy to set the password later from within the MySQL shell.如果您在安装程序时错过了设置密码的机会,那么稍后在 MySQL shell 中设置密码非常容易。

Once you have installed MySQL, we should activate it with this command:安装 MySQL 后,我们应该使用以下命令激活它:

sudo mysql_install_db

Finish up by running the MySQL set up script:通过运行 MySQL 设置脚本来完成:

sudo /usr/bin/mysql_secure_installation

The prompt will ask you for your current root password.提示将询问您当前的 root 密码。

Type it in.输入它。

Enter current password for root (enter for none):输入 root 的当前密码(输入无):

OK, successfully used password, moving on...好的,成功使用密码,继续...

Then the prompt will ask you if you want to change the root password.然后提示会询问您是否要更改root密码。 Go ahead and choose N and move on to the next steps.继续并选择 N 并继续下一步。 It's easiest just to say Yes to all the options.对所有选项都说“是”是最简单的。 At the end, MySQL will reload and implement the new changes.最后,MySQL 将重新加载并实施新的更改。

By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them.默认情况下,MySQL 安装有一个匿名用户,允许任何人登录 MySQL,而无需为他们创建用户帐户。 This is intended only for testing, and to make the installation go a bit smoother.这仅用于测试,并使安装更顺畅。 You should remove them before moving into a production environment.您应该在进入生产环境之前删除它们。

Remove anonymous users?删除匿名用户? [Y/n] y [是/否] 是
... Success! ... 成功!

Normally, root should only be allowed to connect from 'localhost'.通常,root 应该只被允许从 'localhost' 连接。 This ensures that someone cannot guess at the root password from the network.这确保有人无法从网络猜测 root 密码。

Disallow root login remotely?禁止远程root登录? [Y/n] y ... Success! [是/否] 是……成功!

By default, MySQL comes with a database named 'test' that anyone can access.默认情况下,MySQL 带有一个任何人都可以访问的名为“test”的数据库。 This is also intended only for testing, and should be removed before moving into a production environment.这也仅用于测试,应在进入生产环境之前将其删除。

Remove test database and access to it?删除测试数据库并访问它? [Y/n] y - Dropping test database... ... Success! [是/否] 是 - 删除测试数据库... ...成功! - Removing privileges on test database... ... Success! - 删除测试数据库的权限... ...成功!

Reloading the privilege tables will ensure that all changes made so far will take effect immediately.重新加载权限表将确保到目前为止所做的所有更改都将立即生效。

Reload privilege tables now?现在重新加载权限表? [Y/n] y ... Success! [是/否] 是……成功!

Cleaning up...打扫干净...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM