Are you trying to install MySQL on Debian?
This guide is for you.
MySQL is a well-known and open-source relational database management system that is pre-installed on Linux Debian's repository. MariaDB is available as the default database in Debian 10.
Therefore, you need to install the MySQL server with all its dependencies on your Debian 10 system.
Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform Software Installation tasks on their Servers.
In this context, we shall look into how to install the MySQL server on Debian 10.
To install MySQL, you need to log into your Server as the root user with sudo privilege. You can either use your Terminal or an SSH tool such as Putty.
Then follow the steps given below to install the MySQL server on your Debian 10 system:
i. Click on the 'Activities' and then enter the terminal in the application search bar.
ii. Click on the terminal icon which will be displayed under the search bar.
For the installation of MySQL, you need to first add the MySQL apt repository to your Debian 10 system.
i. For this purpose, go to the download page of the repository and grab the latest release of the MySQL package by using the below-mentioned wget command:
$ wget http://repo.mysql.com/mysql-apt-config_0.8.13-1_all.deb
ii. Once the download of the latest release package is completed, install it by executing the following command with sudo privileges:
$ sudo apt install ./mysql-apt-config_0.8.13-1_all.deb
During the installation, the configuration menu will be displayed on the system where you can select the MySQL version that you want to install.
Here, MySQL 8.0 is already selected. You can select other versions according to your server requirements. Now, select 'OK' by pressing the 'Tab' key and hit 'Enter'.
The recommended method is to update the repository packages list before installing any new application on your system.
Therefore, update apt packages by using the following command:
$ sudo apt update
i. After updating the Debian apt repository, you will execute the below-given command to install the MySQL server packages on Debian 10:
$ sudo apt install mysql-server
ii. Here, you will be asked to enter the MySQL root user password. Leave it blank that will set further in this guide.
iii. In the next dialog, a message will display on the system in order to inform you about the MySQL 8.0 authentication.
iv. Ensure that this authentication plugin is supported by your MySQL application, and then select the MySQL 8 authentication plugin.
Once the installation process is completed, MySQL services will automatically start on your system.
You can check service running status by typing the following command:
$ sudo systemctl status mysql
By executing the following command you can make the installation of the MySQL server more secure.
i. Here, you need to set the root account password as follows:
$ sudo mysql_secure_installation
In the next step, you will be prompted to configure the 'VALIDATE PASSWORD PLUGIN'. This plugin is usually used to test the MySQL user's password strength.
It consists of three levels for password validation: low, medium, and strong. If you don't want to configure this plugin the hit 'Enter'.
ii. Next, you will set the root user MySQL account password.
iii. Once you have been entered the root account password, the script will ask you to answer the following questions:
Are you want to remove the anonymous user?
Are you want to restrict the of root user access to the local machine?
Want to remove the test database?
You should be response (yes) press 'y' to all questions in order to successfully complete the secure configuration.
To work on the MySQL database, a necessary package MySQL client is required that is pre-installed as a dependency of the MySQL server package during the installation process.
i. During the installation, if you have selected and installed the default authentication method for root login type then, run the following command:
$ sudo mysql
ii. For legacy authentication method, type the following command on the terminal:
$ mysql -u root -p
iii. You will be asked to enter the root account password which you have set in the above step mysql_secure_installation.
Once you have entered the password, MySQL shell environment will display on the terminal.
This article will guide you on how to #install #MySQL server on Debian 10 #Linux system. Also we looked into how to secure the installation and connect with the MySQL shell. Using the Validate password #plugin you can make a more secure database MySQL password #authentication.
MySQL is an #RDBMS tostore, retrieve, modify and administrate a database usingSQL.
The mysql #command:
1. -h followed by the server host name (server.linuxapt.com).
2. -u followed by the account user name (use your MySQL username).
3. -p which tells mysql to prompt for a password.
4. database the name of the database (use your database name).