一、安装包
下载Mysql安装包 下载地址:MySQL :: Download MySQL Community Server
二、安装Mysql
2.1解压安装包
创建目录
mkdir mysql
解压到创建的目录下
tar -xvf mysql-server_8.0.29-1ubuntu21.10_amd64.deb-bundle.tar -C /home/mysql/
2.2增加执行权限
chmod +x *.deb
2.3安装
安装依赖包
sudo dpkg -i libaio1_0.3.112-9_amd64.deb
按顺序安装mysql
sudo dpkg -i mysql-common_8.0.29-1ubuntu21.10_amd64.deb
sudo dpkg -i libssl1.1_1.1.1l-1ubuntu1_amd64.deb
sudo dpkg -i mysql-community-client-plugins_8.0.29-1ubuntu21.10_amd64.deb
sudo dpkg -i mysql-community-client-core_8.0.29-1ubuntu21.10_amd64.deb
sudo dpkg -i libmysqlclient21_8.0.29-1ubuntu21.10_amd64.deb
sudo dpkg -i libmysqlclient-dev_8.0.29-1ubuntu21.10_amd64.deb
sudo dpkg -i libmecab2_0.996-14+b4_amd64.deb
sudo dpkg -i mysql-community-server-core_8.0.29-1ubuntu21.10_amd64.deb
sudo dpkg -i mysql-community-client_8.0.29-1ubuntu21.10_amd64.deb
sudo dpkg -i mysql-client_8.0.29-1ubuntu21.10_amd64.deb
sudo dpkg -i mysql-community-server_8.0.29-1ubuntu21.10_amd64.deb
弹出root密码输入框:
sudo dpkg -i mysql-community-server_8.0.29-1ubuntu21.10_amd64.deb
2.4 执行数据库脚本(可选项,导入业务初始化数据)
2.4.1 登录
sudo mysql –uroot –p
2.4.2 创建数据库
create database erp;
2.4.3 使用创建的数据库
use erp;
文章来源:https://www.toymoban.com/news/detail-558222.html
2.4.4 执行sql脚本文件
source /home/orm/mysql.sql;
文章来源地址https://www.toymoban.com/news/detail-558222.html
到了这里,关于Ubuntu 离线安装Mysql的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!