简体   繁体   English

在PHP的数据库操作中使用.sql文件

[英]Using a .sql file in Database manipulation with PHP

I am kinda new to the whole development side, but I want to be good. 我是整个开发方面的新手,但我想成为一个好人。

In database creation, I used to do this via PHPMyAdmin --> Wamp Server. 在数据库创建中,我曾经通过PHPMyAdmin-> Wamp Server来做到这一点。

I got to learn how to use MySQL Workbench, and I am liking the experience. 我必须学习如何使用MySQL Workbench,并且我喜欢这种经验。

The problem is, when I have the .sql file created via use of Work Bench, eg data.sql, I cannot import it to PHPMyAdmin, so as to continue in a my developments (web-related) as there are many errors comming up eg #1146. 问题是,当我通过使用Work Bench创建了.sql文件时,例如data.sql,我无法将其导入PHPMyAdmin,以继续进行我的开发(与Web相关),因为会出现许多错误例如#1146。

It is really frustrating since I have to do double work and create what I did in Work Bench in PHP MyAdmin. 确实令人沮丧,因为我必须做双重工作并创建在PHP MyAdmin中的Work Bench中所做的工作。

Is there a simpler way? 有没有更简单的方法?

Like can I just connect to a .sql file (as the database) and continue with execution of my projects? 就像我可以仅连接到.sql文件(作为数据库)并继续执行项目一样吗? (Its a bit stupid, but I have been reduced to that.) (这有点愚蠢,但是我已经沦落为那个。)

Please help. 请帮忙。

Thanks in advance. 提前致谢。

This post seems like it might help you out, did you check the default encoding of the dump and make sure mysql expects the right type of encoding? 这篇文章似乎可以帮助您,是否检查了转储的默认编码并确保mysql期望使用正确的编码类型?

http://forums.mysql.com/read.php?103,275798,275798 http://forums.mysql.com/read.php?103,275798,275798

Also: Please read the policies of the board before asking your question. 另外:在提出问题之前,请阅读董事会政策。 It states to do some research before asking questions like this... I googled "mysql workbench dump to phpmyadmin" and the very first item that popped up was a video explaining this EXACT situation. 它声明要在问这样的问题之前做一些研究...我用谷歌搜索了“ mysql workbench dump to phpmyadmin”,弹出的第一个项目是一个解释这种情况的视频 :) :)

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

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