How to configure MySQL 8.0 Server on Debian 11 Bullseye – Guide

To install MySQL 8 on Debian 11, you will need to:

  1. Install the Debian package manager, apt-get.
  2. Upgrade MySQL Server to version 8.0 or higher. If you have an older version of MySQL Server, you will need to do a tidy upgrade or dump all data, update the packages, and import all the data from the database back into MySQL 8.0.
  3. Copy the mysql-8-server package from the Debian archive to your server’s /etc/apt/sources.list file: sudo apt-get update sudo apt-get install mysql-8-server

prerequisites

Debian 11 is a Debian-based Linux distribution that is designed for servers and workstations. It has a variety of features, including support for multiple languages, a strong security track record, and a user-friendly interface.

A user account with sudo or root access allows the user to perform tasks that would otherwise require elevated privileges, such as changing system settings or editing files.

To download a file using wget or curl, you will need to install the appropriate package. wget is available on most systems, while curl is available on most systems with an installation of the GNU/Linux operating system. ..

Updating operating system

To make sure Debian 11 is up to date, update your system to the latest version.

Install the WGET package

wget https://packages.ubuntu.com/16.04/xenial/xenial-release-1604-1/ xenial-release-1604-1_amd64.deb The Xenial Xerus release is a new version of Ubuntu that uses the Linux 4.x kernel and offers a number of new features and improvements over the previous release, Ubuntu 15.10. The Xenial Xerus release is available to download now from the Ubuntu website. ..

Wget is a tool that can be used to download files. If you are unsure whether you should use wget, please run the command to see if you are unsure.

Import MySQL repository

To install the latest version of MySQL, you will need to download and install the MySQL APT .deb repository package from the official MySQL website. This will set up and install the MySQL software repositories on your Debian system. ..

curl -L https://raw.githubusercontent.com/apache/commons-lang/commons-lang-2.4.0/master/src/main/resources/org/apache/commons/lang3 /usr/share This command downloads the source code for the commons-lang project to your TMP folder.

  1. The MySQL installation window
  2. The MySQL configuration window
  3. The MySQL startup window

Debian 11 stable was just released, and MySQL does not support it. You can fix this by selecting the old stable version Buster, and it will work fine.

Buster was selected and the Enter key was pressed.

You will be asked to confirm which version of MySQL you want to install. For now, it is set up correctly for the latest version. Then using the arrow keys, scroll down and select ok to continue.

The installation process began smoothly, but soon became more complicated. After a few minutes of struggling, I selected OK to continue.

The process has completed. ..

apt update

Install MySQL 8

mysql -u root -p Enter the password for the root user: Install the MySQL server: Now that you have finished importing the repository into MySQL, run the command to install as follows: mysql -u root -p < /path/to/repository.sql Enter the password for the root user: mysql>install; ..

The installation process begins by type Y and pressing the Enter key.

During installation, a new pop-up will appear, prompting you to enter the database root password. Make sure it is secure and registered. Once entered, press the Enter key or press the Tab key to select and press Enter to proceed with the installation.

After re-entering your root password, you will be prompted to enter the user password. After entering the user password, you will be prompted to enter the system password. Once you have entered the system password, you will be able to log in to your account. ..

After you click on the new authentication system, a pop-up will appear for you to read about the new system.

First, set the default authentication plugin for MySQL to be “password”. This will ensure that only passwords are used when connecting to the database. ..

apt-get install mysql This will install the MySQL server and its dependencies.

Check the status of the MySQL 8 server

systemctl status mysql.service If the service is not operational, please enter the following command to start the MySQL service: systemctl start mysql.service ..

To stop the MySQL service on a server, use the following command: mysqladmin stop ..

mysql -u root -p

/etc/init.d/mysql start

To enable MySQL service at system startup, you can use the following command: mysql_secure_installation ..

/etc/init.d/mysql start

Secure MySQL 8 with security script

When installing new MySQL, it is important to follow the default settings carefully in order to avoid potential intrusion or hacker exploitation. One solution is to use the installation security script that comes with MySQL. ..

mysql -u root -p Then, use the following command to connect to the MySQL server: mysql> connect

To continue, you will be asked to enter your user name and password. After you have logged in, you will see a message that says “Welcome to the new My Account.” If you have not changed your password since last logging in, the default password is “password.” If you have changed your password, enter it now and click on the “Update Profile” button. ..

To secure your computer and protect your data, it is important to set a password for the root account. This account has unrestricted access to all of the files on your computer. By setting a password for the root account, you can protect yourself from unauthorized access to your computer. ..

To protect your site from unauthorized access, you can remove root accounts that are accessible from outside the localhost. This will make it more difficult for someone to gain access to your site without proper authorization. ..

The removal of anonymous user accounts from a website or application is an important step in protecting users’ privacy. By removing these accounts, we can ensure that all users are treated equally and that any personal information shared between users is protected.

Remove the anonymous user access to the test database.

After the initial install, you may want to reset your root password.

Log into the MySQL 8 instance

mysql -u root -p Enter the following information to log in: Your MySQL root password: ***** ..

mysql -uroot -p You will be prompted to enter the root password defined in the install setup or post-install security script. Once inside the MySQL service instance, you can run the following command as a test to see it up and running. ..

SELECT * FROM mysql This will show the contents of the mysql database.

To start using MySQL, you must first learn the basics with the following commands: ; MySQL is a popular open source database management system (DBMS) that helps manage data in web applications and other online services. ..

exit

Uninstall MySQL 8

mysql -u root -p This will remove the MySQL database from your system.

Final note

This guide will show you how to configure MySQL 8.0 Server on Debian 11 Bullseye. If you have any questions about this article, please feel free to ask us in the comments section below. Additionally, if you would like to share this article with your friends, please do so by using the social media buttons below. ..