1 Replies - 397 Views - Last Post: 22 March 2018 - 07:17 AM

#1 savedlema   User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 59
  • Joined: 19-June 13

Convert/Import database.txt into mysql phpmyadmin?

Posted 22 March 2018 - 06:30 AM

Greetings!

I got a mysql database "backup" that someone made and I have to use it, trying to get a Joomla website back online. Its a Joomla web database. The person gave me a file "database.txt" (not database.sql) which opens with Notepad. Trying to "import" in phpmyadmin does not work and just gives out errors like

" Ending quote ' was expected. (near "" at position 4438), and " 42 values were expected, but found 21. (near "(" at position 3967) --(which created 7 tables only)

I'm attaching 2 screeshots here so that you guys can see the contents of this file,somewhere it says phpmyadmin SQL dump, making me feel that the file was created by mysqldump, but I wonder why it shows up as .txt and not .sql file.

Is there a way I can still get this database into my server (offline or online)? I will appreciate a guide or an online tutorial on how to accomplish this. I really do need the database.

Thanks.

Is This A Good Question/Topic? 0
  • +

Replies To: Convert/Import database.txt into mysql phpmyadmin?

#2 Martyr2   User is offline

  • Programming Theoretician
  • member icon

Reputation: 5418
  • View blog
  • Posts: 14,330
  • Joined: 18-April 07

Re: Convert/Import database.txt into mysql phpmyadmin?

Posted 22 March 2018 - 07:17 AM

Well if it is a dump file and if you see nothing but SQL statements in it, try renaming the file to database.sql. Now after that if the import still fails, then perhaps the data in it is corrupted or not correctly formatted. Other than going to the spots it complains about and fixing the SQL statements, you might not be able to import it. Maybe they dumped it and then edited it incorrectly?

Can't really say without seeing the file, but before posting make sure it has no sensitive data in it.


P.S. You can also take chunks of the file and execute them directly. MySQL dumps are primarily a long string of SQL statements that it just runs in order.

This post has been edited by Martyr2: 22 March 2018 - 07:18 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1