1. Official website: mysql download link
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
Let’s install this first
sudo dpkg -i ./mysql-common_5.7.29-1ubuntu18.04_amd64.deb
Then install the next one
sudo dpkg -i ./mysql-community-server_5.7.29-1ubuntu18.04_amd64.deb
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
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
Not bad, it was successful, let’s install others
sudo dpkg -i ./libmysqlclient-dev_5.7.29-1ubuntu18.04_amd64.deb
continue
sudo dpkg -i ./libmysqlclient-dev_5.7.29-1ubuntu18.04_amd64.deb
sudo dpkg -i ./libmysqld-dev_5.7.29-1ubuntu18.04_amd64.deb
Next, you can install the client and give it a try.
sudo dpkg -i ./mysql-community-client_5.7.29-1ubuntu18.04_amd64.deb
It seems that this is not possible. This is not included in the package. We need to download it ourselves. Visit the following website
address :
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
OK, now you can install the client
sudo dpkg -i ./mysql-community-client_5.7.29-1ubuntu18.04_amd64.deb
sudo dpkg -i ./mysql-client_5.7.29-1ubuntu18.04_amd64.deb
Success, continue
sudo dpkg -i ./mysql-community-source_5.7.29-1ubuntu18.04_amd64.deb
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
Okay, it looks like there's still a lot missing. Let's go search for it.
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
Re-execute the installation server
sudo dpkg -i ./mysql-community-server_5.7.29-1ubuntu18.04_amd64.deb
sudo dpkg -i ./mysql-server_5.7.29-1ubuntu18.04_amd64.deb
source
sudo dpkg -i ./mysql-community-source_5.7.29-1ubuntu18.04_amd64.deb
Check mysql service status
systemctl status mysql
Login mysql
mysql -uroot
Next, 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