Ubuntu24.04 deb文件 安装 MySQL8.4
ubuntu24.04 deb文件安装 MySQL8
升级系统
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 libaio1t64
下载离线安装包
wget https://cdn.mysql.com//Downloads/MySQL-8.4/mysql-server_8.4.1-1ubuntu24.04_amd64.deb-bundle.tar
解压缩安装包
mkdir mysql & tar -xvf mysql-server_8.4.1-1ubuntu24.04_amd64.deb-bundle.tar -C mysql
安装MySQL8
cd mysql
sudo dpkg -i mysql-{common,community-client-plugins,community-client-core,community-client,client,community-server-core,community-server,server}_*.deb
查看 MySQL状态
sudo systemctl status mysql
登录MySQL
mysql -uroot -p
修改密码和可访问主机地址
ALTER USER 'root'@'localhost' IDENTIFIED BY 'lihaozhe';
flush privileges;update mysql.user set host = '%' where user='root';
flush privileges;quit;
sudo systemctl restart mysql