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. 有状态(Stateful)应用的容器化 - 云+社区 - 腾讯云 https://cloud.tencent.com/developer/article/1020178

    有状态(Stateful)应用的容器化 - 云+社区 - 腾讯云 https://cloud.tencent.com/developer/article/1020178

  2. 记一次压测问题定位:connection reset by peer,TCP三次握手后服务端发送RST_网络_c359719435的专栏-CSDN博客 https://blog.csdn.net/c359719435/article/details/80300433

    记一次压测问题定位:connection reset by peer,TCP三次握手后服务端发送RST_网络_c359719435的专栏-CSDN博客 https://blog.csdn.net/c3 ...

  3. C++学习之STL(二)String

    1.assign assign方法可以理解为先将原字符串清空,然后赋予新的值作替换. 返回类型为 string类型的引用.其常用的重载也有下列几种: a. string& assign ( c ...

  4. 一次SQL盲注记录

    背景:遇到一个sql注入,数字型布尔盲注+waf(直接超时那种),只要能出用户名,数据库名即可. 解决办法: 因为可以只要能出user(),database()即可,所以用不着SELECT,那么问题就 ...

  5. 透明小电视上线——GitHub 热点速览 v.21.05

    作者:HelloGitHub-小鱼干 这周的 GitHub Trending 真是棒极了.小鱼干喜欢的科技博主又开源了他的硬件玩具,一个透明的小电视机,HG 的小伙伴看完项目,再买个电路板和分光棱镜, ...

  6. 十四:SpringBoot-配置MongoDB数据库,实现增删改查逻辑

    SpringBoot-配置MongoDB数据库,实现增删改查逻辑 1.MongoDB数据库 1.1 MongoDB简介 1.2 MongoDB特点 2.SpringBoot整合MongoDB 2.1 ...

  7. 使用session实现网站N天免登陆()

    问题描述: 一些网站的N天之内免登陆实现方式. 方式一: 首先想到的是使用cookie保存用户登录信息,设置有效期,在用户下次访问时免去登录环节,直接通过cookie获取用户信息. 方式二: 方式二: ...

  8. Spring,Spring MVC,MyBatis,Hibernate总结

    将之前学习的框架知识进行了UML图总结,若有错误或不当之处,劳烦朋友们指正,会及时作出修改和补充: [toc] Spring Spring MVC MyBatis,Hibernate

  9. SpringBoot整合spring-security-oauth2完整实现例子

    SpringBoot整合spring-security-oauth2完整实现例子 技术栈 : springboot + spring-security + spring-oauth2 + mybati ...

  10. 【疯狂挖坑】linux服务器尝试中的问题(nohup等)

    实验环境:Ubuntu 16.0.4 首当其冲: 1. nohup使用及究极重要事项 我们用服务器肯定都是想在服务器存点什么.让服务器帮我们干点什么,这时候就需要nohup(no hang up)提供 ...