将 .sql 文件插入您的 MySQL 数据库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13955988/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 15:50:43  来源:igfitidea点击:

Insert .sql file into your MySQL database

mysqldatabasephpmyadminxampp

提问by user1916274

I have installed XAMPP. In this I made a database via PhpMyadmin.

我已经安装了 XAMPP。在这个我通过 PhpMyadmin 创建了一个数据库。

How can I upload a SQL file to the database?

如何将 SQL 文件上传到数据库?

回答by Basith

Follow the setps to upload your sql file to database.

按照 setps 将您的 sql 文件上传到数据库。

  1. Run this link from your browser http://localhost/phpmyadmin.
  2. Select Databasewhich you want to upload the SQLfile. (If no DB , create new database).
  3. Click on Import option from top menu section and upload you files.
  1. 从浏览器运行此链接http://localhost/phpmyadmin
  2. 选择Database您要上传的SQL文件。(如果没有 DB ,则创建新数据库)。
  3. 单击顶部菜单部分的导入选项并上传文件。

Please check the screenshots for your reference.

请检查屏幕截图以供参考。

enter image description hereenter image description hereTry It... This will helps you....

在此处输入图片说明在此处输入图片说明试试看...这会帮助你....

回答by Benabra

In your mysql console you have to type this command :

在您的 mysql 控制台中,您必须键入以下命令:

mysql> use YourDataBaseName
mysql> source YourFile.sql

or in your console type :

或在您的控制台类型中:

mysql -u root -p [YourPassword] [YourDataBaseName < YourFile.sql

For more information you can visit: http://www.cyberciti.biz/faq/import-mysql-dumpfile-sql-datafile-into-my-database/

有关更多信息,您可以访问:http: //www.cyberciti.biz/faq/import-mysql-dumpfile-sql-datafile-into-my-database/

回答by AgeDeO

In phpmyadmin choose import in the top menu and open your sql file from that page

在 phpmyadmin 中选择顶部菜单中的导入并从该页面打开您的 sql 文件