1 Download the deb format installation package from the official website
URL:
https://downloads.mysql.com/archives/community/
2 Unzip the installation package
Excuting an order:tar -xvf mysql-server_5.7.41-1ubuntu18.04_amd64.deb-bundle.tar
As shown below:
You will find a lot more .deb files.
3 Batch install files in .deb format:
cd to the root directory where the .deb is stored, and then execute the following command:sudo dpkg -i ./*.deb
Then it will start to install these deb packages like crazy, as shown in the figure below:
4 Dependency conflict (error reporting problem) resolution
The error message is as follows:
Obviously, it's because of missing dependencies. We just need to solve the dependency problem from scratch. As shown above, we are first missing: libtinfo5. Then we start installing it:
sudo apt install libtinfo5
5 Follow the prompts to execute apt --fix-broken install to resolve all dependencies.
The execution result is shown in the figure below:
6 Set mysql root password
During the conflict resolution, the related dependencies of mysql will be automatically installed and you will be asked to enter the root password. I didn't take a screenshot at that time, you can just set a password
7 Log in after installation is complete
Excuting an order:mysql -uroot -p
You will be asked to enter the password you just set. After completion, enter the mysql interface:
You're done!
8 Postscript: Uninstall
Based on the previously installed packages:
Theoretically, you only need sudo dpkg -r ./*.deb to uninstall them. In short, just execute the uninstall command of dpkg.