Ubuntu deb文件 安装 MySQL
升级系统
sudo apt update
sudo apt -y dist-upgrade
安装常用工具
sudo apt -y install vim net-tools wget gcc make cmake lrzsz
安装依赖
sudo apt -y install libmecab2 libjson-perl
下载离线安装包
wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-server_8.0.31-1ubuntu22.04_amd64.deb-bundle.tar
解压缩安装包
mkdir mysql & tar -xvf mysql-server_8.0.31-1ubuntu22.04_amd64.deb-bundle.tar -C mysql
安装MySQL8
cd mysql
sudo dpkg -i mysql-{
common,community-client,community-client-core,community-client-plugins,client,community-server,community-server-core,server}_*.deb
修改密码和可访问主机地址
select host , user , plugin ,authentication_string from mysql.user;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'lihaozhe';
flush privileges;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'lihaozhe';
flush privileges;
update mysql.user set host = '%',plugin='mysql_native_password' where user='root';
flush privileges;
quit;
sudo systemctl restart mysql