1.下载mysql8
MySQL :: Download MySQL Installer (Archived Versions)
选择对应的mysql版本和对应的ubuntu版本图即可
2.下载后上传到sftp文件夹中,然后通过以下命令解压
tar -xvf mysql-server_8.0.29-1ubuntu20.04_amd64.deb-bundle.tar
3.依次安装即可 ,碰到以下问题
dpkg -i mysql-community-client-plugins_8.0.29-1ubuntu20.04_amd64.deb
dpkg -i mysql-community-client-core_8.0.29-1ubuntu20.04_amd64.deb
dpkg -i mysql-common_8.0.29-1ubuntu20.04_amd64.deb
dpkg -i mysql-community-client_8.0.29-1ubuntu20.04_amd64.deb
dpkg -i libmysqlclient21_8.0.29-1ubuntu20.04_amd64.deb
dpkg -i libmysqlclient-dev_8.0.29-1ubuntu20.04_amd64.deb
dpkg -i mysql-client_8.0.29-1ubuntu20.04_amd64.deb
dpkg -i libmecab2_0.996-10build1_amd64.deb #依赖包
dpkg -i mysql-community-server-core_8.0.29-1ubuntu20.04_amd64.deb
dpkg -i mysql-community-server_8.0.29-1ubuntu20.04_amd64.deb
dpkg -i mysql-server_8.0.29-1ubuntu20.04_amd64.deb
4.根据划红线的问题 ,依次安装即可
5.如果碰到缺少libtinfo2 ,去以下地址下载即可
http://archive.ubuntu.com/ubuntu/pool/universe/m/mecab/libmecab2_0.996-1.2ubuntu1_amd64.deb
6.如何配置远程连接?
1、在装有MySQL的机器上登录MySQL mysql -u root -p密码 ;
2、执行use mysql;
3、执行update user set host = ‘%’ where user = ‘root’;这一句执行完可能会报错,不用管它。
4、执行FLUSH PRIVILEGES;
7.如果安装时没有配置密码,那么在用远程工具连接时就会出现1698 - Access denied for user 'root @'192.168.37.144,解决方法如下
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '密码';
到这里就可以正常连接操作数据库了