ubuntu (Linux mint) install mysql 5.7

1 Download the deb format installation package from the official website

URL:

https://downloads.mysql.com/archives/community/

Insert image description here

2 Unzip the installation package

Excuting an order:tar -xvf mysql-server_5.7.41-1ubuntu18.04_amd64.deb-bundle.tar

As shown below:

Insert image description here

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:

Insert image description here

4 Dependency conflict (error reporting problem) resolution

The error message is as follows:

Insert image description here

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

Insert image description here

5 Follow the prompts to execute apt --fix-broken install to resolve all dependencies.

The execution result is shown in the figure below:

Insert image description here

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:

Insert image description here

You're done!

8 Postscript: Uninstall

Based on the previously installed packages:

Insert image description here

Theoretically, you only need sudo dpkg -r ./*.deb to uninstall them. In short, just execute the uninstall command of dpkg.

おすすめ

転載: blog.csdn.net/weixin_44757863/article/details/131227716