Page 1 of 1

Import DB in XAMPP

PostPosted: 14. September 2015 17:19
by demirk
Hi everybody,
i'm newbie and I make a disaster. I work for days to a project offline, and I accidentally deleted the db on xampp.
Is there a way to rescue it?
I exported the db (.sql) before the disaster, but I'm not able to re-import it in xampp!

This is the error log

phpMyAdmin SQL Dump
-- version 4.4.12
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Creato il: Set 11, 2015 alle 17:52
-- Versione del server: 5.6.25
-- Versione PHP: 5.6.11

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
Messaggio di MySQL: Documentazione

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'phpMyAdmin SQL Dump
-- version 4.4.12
-- http://www.phpmyadmin.net
--
-- Host: 1' at line 1

Thank you so much for your support!

Re: Import DB in XAMPP

PostPosted: 14. September 2015 17:25
by Altrea
Hi demirk,

demirk wrote:#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'phpMyAdmin SQL Dump

MySQL has no clue what to do with the line
Code: Select all
phpMyAdmin SQL Dump


Either comment this line out by placing a -- in front of it or delete the entire line.
After that retry to import your dump.
If it still is not successful the error message will change to spot the new problem.

best wishes,
Altrea

Re: Import DB in XAMPP

PostPosted: 17. September 2015 13:57
by demirk
Many many thank you! After some errors I finally solve the problem!
Just a question, it works only if I create a new database. What I must do if I want to import it on an existing db?
(For example in altervista, where I have only a db and I can't create a new one)

I changed the name of database on the sql but appears this error: #1046 - No database selected