0

I am doing a course on MySQL and we had to download a file to populate a database with data after we make the database, but the file is just "Export" on already made database and it has its own "CREATE TABLE IF NOT EXISTS" which means you can basically use it to create the database and populate it with data.

Here is the file https://pastebin.com/u1iWcQgx (its too big to just paste here)

What I am doing

1.Open phpmyadmin

2.Create new database cardbenter image description here

3.Import the file enter image description here

And here is what I get when I press "GO"

enter image description here

My problem is that even if I need to change something...why should I need to? I mean...nobody else got this problem and this file is auto generated so there must be no errros....I suppose it is something with the database I create.

[EDIT] I used HeidiSQL and it worked perfectly....which makes me even more confused as to what is the problem.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Pavlin Petkov
  • 1,022
  • 3
  • 17
  • 38
  • This is unrelated to PHP, removed the tag. – ADyson Dec 05 '17 at 13:45
  • What version of MySQL are you trying to import into? A quick test using SQLFiddle reveals your script works with MySQL 5.6 (the latest version). Also when you say you used HeidiSQL, was it pointing to the same mySQL server? – ADyson Dec 05 '17 at 13:48
  • https://stackoverflow.com/a/4673775/7013297 please read this i think this will help you. – tech_geek Dec 05 '17 at 13:51
  • @ADyson I have run MySQL with XAMPP and both phpmyadmin and HeidiSQL are using the same MySQL server so everything is the same. After doing it in HeidiSQL I did open phpmyadmin and everything was there so the MySQL is the same its just different UI tool which confuses me. The only difference is the Collation in HeidiSQL it is `utf8_general_ci `if this matters. – Pavlin Petkov Dec 05 '17 at 14:12
  • I doubt that would affect the creation of a foreign key constraint. Like I said, what version of mySQL are you targeting? What version was the SQL file created from? What version of phpMyAdmin do you have? – ADyson Dec 05 '17 at 14:17

0 Answers0