码迷,mamicode.com
首页 > 数据库 > 详细

[转]debian9 安装任意版本mysql

时间:2018-03-06 10:50:29      阅读:327      评论:0      收藏:0      [点我收藏+]

标签:too   run   awesome   popup   similar   png   div   orm   nbsp   

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 root@localhost 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

标签:too   run   awesome   popup   similar   png   div   orm   nbsp   

原文地址:https://www.cnblogs.com/tibit/p/8512886.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!