Server Ubuntu 22.04 64-bit installation MySQL5.7

1. Official website: mysql download link

Official website address

Insert image description here

2. Let’s create a new folder with the path /usr/local/mysql

Here choose to download the ubuntu version 5.7.29. Note that it is amd64 not arm64, or execute the following command

 wget https://downloads.mysql.com/archives/get/p/23/file/mysql-server_5.7.29-1ubuntu18.04_amd64.deb-bundle.tar

Unzip the downloaded package

 tar -xvf ./mysql-server_5.7.29-1ubuntu18.04_amd64.deb-bundle.tar

ls and see what’s there

Insert image description hereLet’s install this first

sudo dpkg -i ./mysql-common_5.7.29-1ubuntu18.04_amd64.deb

Insert image description hereThen install the next one

sudo dpkg -i ./mysql-community-server_5.7.29-1ubuntu18.04_amd64.deb

Insert image description here
It’s a welcome error, saying that we haven’t installed the two in the red circle. Let’s install it.

sudo dpkg -i ./mysql-community-client_5.7.29-1ubuntu18.04_amd64.deb

Insert image description here
Well, the server depends on the client, and the client lacks libtinfo5, so you can’t install the client first. Install the other ones first.

sudo dpkg -i ./libmysqlclient20_5.7.29-1ubuntu18.04_amd64.deb 

Insert image description here
Not bad, it was successful, let’s install others

 sudo dpkg -i ./libmysqlclient-dev_5.7.29-1ubuntu18.04_amd64.deb

Insert image description here
continue

 sudo dpkg -i ./libmysqlclient-dev_5.7.29-1ubuntu18.04_amd64.deb

Insert image description here

sudo dpkg -i ./libmysqld-dev_5.7.29-1ubuntu18.04_amd64.deb 

Insert image description here
Next, you can install the client and give it a try.

sudo dpkg -i ./mysql-community-client_5.7.29-1ubuntu18.04_amd64.deb 

Insert image description hereIt seems that this is not possible. This is not included in the package. We need to download it ourselves. Visit the following website
address :

Insert image description here
Search for the adapted version to download, or use the following command:

 wget http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2_amd64.deb

Downloaded, installed

 sudo dpkg -i ./libtinfo5_6.3-2_amd64.deb 

Insert image description here
OK, now you can install the client

sudo dpkg -i ./mysql-community-client_5.7.29-1ubuntu18.04_amd64.deb

Insert image description here

sudo dpkg -i ./mysql-client_5.7.29-1ubuntu18.04_amd64.deb

Insert image description here
Success, continue

 sudo dpkg -i ./mysql-community-source_5.7.29-1ubuntu18.04_amd64.deb

Insert image description here
After the client is installed, it’s time to install the server.

sudo dpkg -i ./mysql-community-server_5.7.29-1ubuntu18.04_amd64.deb

Insert image description here
Okay, it looks like there's still a lot missing. Let's go search for it.

Insert image description here
Or use the command

wget http://archive.ubuntu.com/ubuntu/pool/main/m/mecab/libmecab2_0.996-14build9_amd64.deb

Install

sudo dpkg -i ./libmecab2_0.996-14build9_amd64.deb

Insert image description here
Re-execute the installation server

sudo dpkg -i ./mysql-community-server_5.7.29-1ubuntu18.04_amd64.deb

Insert image description here

sudo dpkg -i ./mysql-server_5.7.29-1ubuntu18.04_amd64.deb

Insert image description here
source

 sudo dpkg -i ./mysql-community-source_5.7.29-1ubuntu18.04_amd64.deb 

Insert image description here
Check mysql service status

systemctl status mysql

Insert image description hereLogin mysql

 mysql -uroot

Insert image description hereNext, change the password and allow remote connections and it will be OK.

mysql -uroot -p

use mysql;
update user set host='%' where user='root';
flush privileges;

If you cannot log in to mysql remotely

Change

sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
//把bind-address  = 127.0.0.1  注释掉 
service mysql restart

Then log in remotely

Guess you like

Origin blog.csdn.net/weixin_45500785/article/details/129401590