当前位置:网站首页>gin-vue-admin 使用docker容器中的数据库
gin-vue-admin 使用docker容器中的数据库
2022-07-27 05:23:00 【lianyz1985】
本机情况
- 使用gin-vue-admin的分支gin-vue-admin_v1_stable
- mysql8.0容器 端口为3307
初始化mysql容器中的数据库
通过以下命令将qmplus.sql文件拷贝到容器中
cd ~/gin-vue-admin/QMPlusServer/db/qmplus.sql
docker cp ./qmplus.sql mysql8.0:/home
通过容器CLI进入容器的命令行;
运行以下命令创建数据库
mysql -u root -p
> create database qmPlus;
> use qmPlus;
> show databases;
> show tables;
> source /home/qmplus.sql;
运行后端
修改后端数据库配置
~/gin-vue-admin/QMPlusServer/static/config/config.json 修改以下内容
"mysqladmin": {
"username": "root",
"password": "root",
"path": "127.0.0.1:3307",
"dbname": "qmPlus",
...
编译并启动后端
cd ~/gin-vue-admin/QMPlusServer/
go build
./gin-vue-admin
运行前端
cd ~/gin-vue-admin/QMPlusVuePage/
npm install
npm run serve
边栏推荐
猜你喜欢
随机推荐
Joint query of database
iptables防火墙及SNAT和DNAT
C language minesweeping latest recursive expansion super detailed explanation (with source code)
Iptables firewall
Addition, deletion, modification and query of the database at the terminal
数据库命令
Shell Scripting format
Linu performance tuning: how can we alleviate the situation in the face of DDoS attacks?
Programming learning records - Lesson 9 [operators]
LAMP--源码编译安装
Programming learning records - Lesson 5 [branch and loop statements]
磁盘管理与文件系统
Unit integration (grounding) test
regular expression
Packaging of logging logs
shell之if条件语句
Common font and color settings of markdown documents
Shell Function
项目实训经历2
源码编译安装LAMP和DISCUZ论坛









