当前位置:网站首页>win命令行中导入、导出数据库相关表
win命令行中导入、导出数据库相关表
2022-06-27 07:38:00 【晴泪】
命令行导出数据库相关表为sql文件
语法:mysqldump -h[主机所在IP] -u[用户名] -p[密码] [要导出的数据库]>[导出的路径/文件名.sql]
提示:不用进入数据库
第一行代码不用输入密码(第二行输入)
例子:mysqldump -hlocalhost -uroot -p spring>d:/qqq.sql

没有报错信息提示就是成功了
命令行导入SQL文件到MySQL中
1、登录mysql
语法:mysql -u[用户名] -p[密码];
例子:mysql -uroot -proot

2、进入数据库(如果没有则需要创建)
创建数据库语法:create database [数据库名] charset='utf8'
例子:use spring;

3、导入数据表
语法:source [所在的路径/文件名.sql]
例子:source d:/qqq.sql;

可能出现的错误
ERROR 1046 (3D000): No database selected
原因:没有选择数据库(use [数据库名])
ERROR 1231 (42000): Variable 'foreign_key_checks' can't be set to the value of 'NULL'
原因:内存限制(修改my.ini文件max_allowed_packet=1024M)
边栏推荐
猜你喜欢

Speech signal feature extraction process: input speech signal - framing, pre emphasis, windowing, fft- > STFT spectrum (including amplitude and phase) - square the complex number - > amplitude spectru

How to view program running time (timer) in JS

JS find the number of all daffodils

IDEA连接数据库报错

Cookie加密6

volatile 和 synchronized 到底啥区别?

一个人管理1000台服务器?这款自动化运维工具一定要掌握

One person manages 1000 servers? This automatic operation and maintenance tool must be mastered

Solve the problem of win10 wsl2 IP change

js例题打印1-100之间所有7的倍数的个数及总和
随机推荐
延时队列`DelayQueue`
MySQL
Cookie encryption 6
log4j:WARN No such property [zipPermission] in org.apache.log4j.RollingFileAppender.
JDBC读取Mysql数据列表
Stream常用操作以及原理探索
专业四第二周自测
再见了,敏捷Scrum
JDBC operation MySQL example
碎煤机crusher
(笔记)Anaconda-Navigator闪退解决方法
window右键管理
js中判断奇偶的函数,求圆面积的函数
语音信号处理-概念(一):时谱图(横轴:时间;纵轴:幅值)、频谱图(横轴:频率;纵轴:幅值)--傅里叶变换-->时频谱图【横轴:时间;纵轴:频率;颜色深浅:幅值】
Bean copy details
Delay queue `delayqueue`
Goodbye, agile Scrum
无论LCD和OLED显示技术有多好,都无法替代这个古老的显示数码管
ggplot2的自定义调色板
Solve the problem of win10 wsl2 IP change