ubuntu离线安装mysql

https://dev.mysql.com/downloads/mysql/

下载离线包

 

tar -xvf mysql-server_8.4.3-1ubuntu24.04_amd64.deb-bundle.tar -C /mysql

解压完依次执行:

复制代码
dpkg -i  mysql-community-client-plugins_8.4.3-1ubuntu24.04_amd64.deb
dpkg -i  mysql-community-client-core_8.4.3-1ubuntu24.04_amd64.deb
dpkg -i  mysql-common_8.4.3-1ubuntu24.04_amd64.deb
dpkg -i  mysql-community-client_8.4.3-1ubuntu24.04_amd64.deb
dpkg -i  mysql-client_8.4.3-1ubuntu24.04_amd64.deb
dpkg -i  libmysqlclient24_8.4.3-1ubuntu24.04_amd64.deb
dpkg -i  libmysqlclient-dev_8.4.3-1ubuntu24.04_amd64.deb
dpkg -i  mysql-community-server-core_8.4.3-1ubuntu24.04_amd64.deb
dpkg -i  mysql-community-server_8.4.3-1ubuntu24.04_amd64.deb
dpkg -i  mysql-server_8.4.3-1ubuntu24.04_amd64.deb
如遇失败:sudo apt-get remove --purge ...
复制代码

mysql server安装过程中会提示输入root用户密码,待所有安装完成后,使用命令登陆即可。如密码设置为123456

查看启动状态

sudo systemctl start mysql

设置MySQL开机启动:
sudo systemctl enable mysql

默认都是localhost,把root调整为远程登录用户
use mysql;
update user set host = '%' where user = 'root';

刷新
FLUSH PRIVILEGES;

优化Mysql配置
mysql> set global max_connections=3000 ##最大连接数
mysql> set global thread_cache_size=60; ##最大并发数
use mysql;
update user set host = '%' where user = 'root';
mysql> set global max_connections=3000 ##最大连接数
mysql> set global thread_cache_size=60; ##最大并发数
posted @   _Lawrence  阅读(294)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
历史上的今天:
2018-11-05 html或jsp页面自动提交,无需每次重启服务
点击右上角即可分享
微信分享提示