从特定文件位置导入 mysql 数据库的脚本
问题描述:
可能的重复:
是否可以导入sql从 url 文件到 mysql 数据库
我想将一个 SQL 文件导入我的数据库.问题是我无法将这个文件传送到我的电脑,因为它太大了.
I want to import an SQL file to my database. The problem is that I can't get this file to my computer because it is too big file.
我想通过它的URL 使用 MySQL 从服务器导入它.
I want to import it from the server through it's URL using MySQL.
答
如果文件可以通过 URL 访问,你可以这样做:
If the file is accessible through a URL, you can do:
curl 'http://whatever' | mysql -u username -p db_name