Ubuntu 离线安装Mysql

2019-07-25 16:50:44 浏览数 (1)

一、安装包

先从网络上,下载Mysql安装包 下载地址:https://dev.mysql.com/downloads/mysql/

二、安装Mysql

2.1 解压安装包

tar -xvf mysql-server_5.6.37-1ubuntu14.04_amd64.deb-bundle.tar

2.2 增加执行权限

chmod x *.deb

2.3 安装

2.3.1 安装依赖包

sudo dpkg –i libaio1_0.3.110-2_amd64.deb

2.3.2 按顺序安装mysql

sudo dpkg -i mysql-common_5.6.37-1ubuntu14.04_amd64.deb sudo dpkg -i mysql-community-server_5.6.37-1ubuntu14.04_amd64.deb sudo dpkg -i libmysqlclient18_5.6.37-1ubuntu14.04_amd64.deb sudo dpkg -i libmysqlclient-dev_5.6.37-1ubuntu14.04_amd64.deb sudo dpkg –i libmysqld-dev_5.6.37-1ubuntu14.04_amd64.deb sudo dpkg –i mysql-community-client_5.6.37-1ubuntu14.04_amd64.deb sudo dpkg –i mysql-client_5.6.37-1ubuntu14.04_amd64.deb sudo dpkg –i mysql-common_5.6.37-1ubuntu14.04_amd64.deb sudo dpkg –i mysql-community-server_5.6.37-1ubuntu14.04_amd64.deb

弹出root密码输入框:

sudo dpkg –i mysql-server_5.6.37-1ubuntu14.04_amd64.deb

2.4 执行数据库脚本(可选项,导入业务初始化数据)

2.4.1 登录

mysql mysql –uroot –p

2.4.2 创建数据库

create database erp;

2.4.3 使用创建的数据库

use erp;

2.4.4 执行sql脚本文件

source /home/orm/mysql.sql;

0 人点赞