ObjectiveMySQL is no longer a default SQL database on Debian Linux starting with Debian 9 Stretch. The objective is to install MySQL community server using official MySQL repositories.
Operating System and Software Versions
- Operating System: - Debian 9 Stretch
- Software: - MySQL Community Server 5.7.18
RequirementsPrivileged access to to your Debian server will be required.
- # - requires given linux commands to be executed with root privileges either directly as a root user or by use of
- $ - requires given linux commands to be executed as a regular non-privileged user
Obtain Repository ConfigMost likely the easiest way to install MySQL community server on Debian 9 Stretch is via pre-reconfigured official MySQL repositories. This can be achieved by downloading and installing a
Head over to
https://dev.mysql.com/downloads/repo/apt/and download the latest MySQL APT Repository package. Example:
$ wget https://dev.mysql.com/get/mysql-apt-config_0.8.6-1_all.deb $ ls mysql-apt-config_0.8.6-1_all.deb
Install Repository ConfigNow that you have MySQL APT Repository package available, use
gdebicommand to install it. In case the
gdebicommand is not available on your system you can install it by
# apt install gdebi-core:
# gdebi mysql-apt-config_0.8.6-1_all.deb Reading package lists... Done Building dependency tree Reading state information... Done Reading state information... Done Auto configuration for MySQL APT Repo. MySQL is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query language in the world. The main goals of MySQL are speed, robustness and ease of use. Do you want to install the software package? [y/N]:yFollow the installation wizard by selecting an appropriate MySQL server version and repositories. Default should work in most cases. You can always review your selection manual by editing
/etc/apt/sources.list.d/mysql.listsources list directly.
Install MySQL ServerAt this stage make sure to run:
# apt updatecommand to update system's package repositories. After that, all what has left is to install MySQL packages using
# apt install mysql-serverThe above command will also fetch and install MySQL client. Once installed, confirm the installation by accessing MySQL console:
# mysql -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.7.18 MySQL Community Server (GPL) Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>