how to import a SQL file in MySQL command line

execute .sql file, macOS

$mysql> source \home\user\Desktop\test.sql;

# file path === /Users/xgqfrms-mbp/Documents/GitHub/cms-koa-server/cms-koa/schema.sql
#
$mysql> source /Users/xgqfrms-mbp/Documents/GitHub/cms-koa-server/cms-koa/schema.sql; #
# $mysql> source \Users\xgqfrms-mbp\Documents\GitHub\cms-koa-server\cms-koa\schema.sql;

Error

OK

command line & source

# MySQL command line

# file path === /Users/xgqfrms-mbp/Documents/GitHub/cms-koa-server/cms-koa/schema.sql
#
$mysql> source /Users/xgqfrms-mbp/Documents/GitHub/cms-koa-server/cms-koa/schema.sql;

mysql Client Options

$ mysql -u username -p database_name < file.sql

https://dev.mysql.com/doc/refman/8.0/en/mysql-command-options.html

https://stackoverflow.com/questions/17666249/how-do-i-import-an-sql-file-using-the-command-line-in-mysql

refs



xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


how to import a SQL file in MySQL command line的更多相关文章

  1. mysql 乱码问题(程序界面显示正常,mysql command line显示乱码)

    今天用java写一个程序,用的是mysql数据库.界面出现乱码,然后写了一个过滤器结果了乱码问题. 但是,当我在mysql command line 中查询数据的时候,在界面上显示正常的数据,在mys ...

  2. Building Xcode iOS projects and creating *.ipa file from the command line

    For our development process of iOS applications, we are using Jenkins set up on the Mac Mini Server, ...

  3. Mysql安装后打开MySQL Command Line Client闪退解决方法

    1.开始菜单下;Mysql--->mysql server 5.6-->mysql command line Client ---右击,选择属性 2.在属性下查看目标位置: 3.将安装目录 ...

  4. (转)mysql command line client打不开(闪一下消失)的解决办法

    转自:http://www.2cto.com/database/201209/153858.html 网上搜索到的解决办法: 1.找到mysql安装目录下的bin目录路径. 2.打开cmd,进入到bi ...

  5. 安装SQL Servre2000时提示“command line option syntax error! type command /? for help”

    问题: 当程序正在安装ms数据访问组件时,弹出错误提示框:command line option syntax error,type command/? for help,点击确定继续:到了程序正在安 ...

  6. MySql command line client 命令系列

    —————————————————————————————————————————————————————————— 一.启动与退出 1.进入MySQL:启动MySQL Command Line Cl ...

  7. MySQL Command Line Client显示中文的部分为空

    一连接数据库的时候就设置如下: 先设置 set names gbk,然后再插入就显示中文

  8. Mysql command line

    show databasename; use databasename; show tables; desc tablename;

  9. sql点滴40—mysql乱码问题总结

    原文:sql点滴40-mysql乱码问题总结 本文将为大家讲解如何处理Java连接过程中的MySQL中文乱码问题.一般MySQL中文乱码问题都是与字符集有关,这里作者的经历也大致差不多. MySQL默 ...

随机推荐

  1. Jmeter如何录制APP客户端脚本

    简单五步教大家Jmeter录制APP客户端脚本: Step1 右键单击该测试计划,选择"添加"-"线程组",添加一个线程组. Step2 为了录制客户端的操作, ...

  2. .net core 和 WPF 开发升讯威在线客服与营销系统:使用 TCP协议 实现稳定的客服端

    本系列文章详细介绍使用 .net core 和 WPF 开发 升讯威在线客服与营销系统 的过程.本产品已经成熟稳定并投入商用. 在线演示环境:https://kf.shengxunwei.com 注意 ...

  3. SELECT ... FOR UPDATE or SELECT ... FOR SHARE Locking Reads session

    小结: 1.注意使用限制 Locking reads are only possible when autocommit is disabled (either by beginning transa ...

  4. https://hbase.apache.org/devapidocs/org/apache/hadoop/hbase/util/MurmurHash.html

    https://hbase.apache.org/devapidocs/org/apache/hadoop/hbase/util/MurmurHash.html https://github.com/ ...

  5. 竞态条件 race condition data race

    竞态条件 race condition Race condition - Wikipedia https://en.wikipedia.org/wiki/Race_condition A race c ...

  6. xss靶场详解

    一个XSS靶场练习记录 https://blog.csdn.net/qq_41500251/article/details/101116697 001.level 1 反射型 1.观察源码 <s ...

  7. Jsp数字格式化

    日期格式(2008年5月5日22点00分23秒) <fmt:formatDate value="<%=new Date() %>" pattern="y ...

  8. python 拼接字

    在编译脚本的时候,由于脚本的框架是统一写好的,于是乎用上了拼接字的功能, 本脚本实现的是波特率设置的自动化,利用的是正则表达式,TASK函数是统一写好的,此处只做调用 from Args import ...

  9. SSH入门开发(实现一个简单的登录功能)详解

    开头,首先想记录下一首诗,是今天拇指阅读看到的:很有感触,所以乐于分享: 那么,下面正式开始进入正题,搭建一个 SSH完整的项目: 首先,我们需要在WEB-ROOT下创建一个login.jsp(登录) ...

  10. 查看linux系统 公网ip

    查公网IP时候, 百度输入 IP可看 linux 系统(无界面) : curl cip.cc