简体   繁体   English

将 sql 转储文件导入 PHPMyAdmin

[英]Importing sql dump file into PHPMyAdmin

Here is what I am dealing with, and I apologize for not being very sure of what I am doing.这是我正在处理的问题,我很抱歉我不太确定我在做什么。

I am trying to import a sql database dump file into xampp so that I can run a friends application.我正在尝试将 sql 数据库转储文件导入 xampp,以便我可以运行朋友应用程序。

I cloned the repository and put the code base into my htdocs folder.我克隆了存储库并将代码库放入我的 htdocs 文件夹中。 However, it needs to communicate with the database to run.但是,它需要与数据库通信才能运行。

I have the dump file however when I go to import it I get the following:我有转储文件,但是当我导入它时,我得到以下信息:

 Error SQL query: DROP TABLE IF EXISTS `sl_address` MySQL said: Documentation #1046 - No database selected

Do I need to create a database to dump into before I import the sql dump file?在导入 sql 转储文件之前,是否需要创建要转储到的数据库? If so, does it matter what I name it, if it does how do I know what to name it?如果是这样,我给它起什么名字有关系吗,如果是这样,我怎么知道给它起什么名字? I imagine if I don't name it correctly that the application won't be able to communicate with it.我想如果我没有正确命名它,应用程序将无法与之通信。

I am really new to all this so I appreciate any help I can get.我对这一切真的很陌生,所以我很感激我能得到的任何帮助。 Thank you!谢谢!

I think you need to create a database and select it before you run the SQL script that was generated by the dump.我认为您需要创建一个数据库并在运行由转储生成的 SQL 脚本之前选择它。

Something like this:像这样的东西:

create database newdb;
use newdb;

then the rest of your script.然后是脚本的其余部分。

Bobby鲍比

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM