[转]debian9 安装任意版本mysql

Posted aj117

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[转]debian9 安装任意版本mysql相关的知识,希望对你有一定的参考价值。

Debian 9 - Install mysql Server

The steps below will show you how to install whichever version of MySQL-server you want on your Debian 9 server and why you should not just run sudo apt install mysql-server -y

Similar Posts

Steps

Usually, to install MySQL on a distro, you would just perform the following commands:

sudo apt update
sudo apt install mysql-server -y

You would then receive either MySQL 5.5, 5.6, or 5.7 depending on which distro you were using, but they were all versions of MySQL. However, with Debian 9, if you do this you will end up installing MariaDB 10.1 which is a drop in replacement for 5.6.

If you decide to just go with MariaDB 10.1 and are confused by the lack of a prompt to set the root password, just login with sudo mysql and then use mysql command to set the password: GRANT ALL ON *.* TO [email protected] identified by ‘myawesomepassword‘;

Install MySQL 5.6, 5.7, or 5.8-preview

If you really want MySQL instead of MariaDB for whatever reason, you can execute the script below to install the version you want.

#!/bin/bash
cd /tmp
wget https://dev.mysql.com/get/mysql-apt-config_0.8.7-1_all.deb
sudo dpkg -i mysql-apt-config_*.deb

At the popup-page, select the version you want.

技术分享图片

Then use the following commands to install the MySQL server (it will install the version you selected).

sudo apt update
sudo apt install mysql-community-server -y

References

以上是关于[转]debian9 安装任意版本mysql的主要内容,如果未能解决你的问题,请参考以下文章

Debian之MySQL

debian9安装mysql mariadb

Debian9 在LAMP环境安装和部署WordPress

debian9 安装docker 以及在docker中 安装centos 6 安装指定版本的PHP和MySQ

在Debian9中将python版本添加到vscode

deepin下安装MySQL8.0