Page 1 of 1

Importing sql file to phpmyadmin

PostPosted: 08. January 2019 08:49
by israr7
When i try importing my sql to phpmyadmin it gives the following error
Any solution to it ?


SQL query:
--
-- Dumping data for table `wp_nextend2_smartslider3_slides`
--

INSERT INTO `wp_nextend2_smartslider3_slides` (`id`, `title`, `slider`, `publish_up`, `publish_down`, `published`, `first`, `slide`, `description`, `thumbnail`, `params`, `ordering`, `generator_id`) VALUES
(5, 'Full 2', 2, '2015-11-11 08:19:28', '2025-11-12 08:19:28', 1, 0, '[{\"type\":\"layer\",\"lastplacement\":\"absolute\",\"desktopportraitfontsize\":100,\"desktopportraitparentalign\":\"center\",\"desktopportraitparentvalign\":\"middle\",\"desktopportraitalign\":\"center\",\"desktopportraitvalign\":\"middle\",\"desktopportraitleft\":-68,\"desktopportraittop\":95,\"desktopportraitwidth\":261,\"desktopportraitheight\":90,\"id\":\"\",\"uniqueclass\":\"\",\"class\":\"\",\"crop\":\"visible\",\"rotation\":0,\"parallax\":0,\"adaptivefont\":0,\"generatorvisible\":\"\",\"desktopportrait\":1,\"desktoplandscape\":1,\"tabletportrait\":1,\"tabletlandscape\":1,\"mobileportrait\":1,\"mobilelandscape\":1,\"name\":\"More\",\"namesync[...]


MySQL said:

#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 's
(9, '1465237060_resolutions-11.png', 3, '2018-09-30 06:27:15', '2028-10-01 06:' at line 9

Re: Importing sql file to phpmyadmin

PostPosted: 08. January 2019 18:20
by Nobbie
Try to import your SQL file via mysql interpreter instead of phpmyadmin, thats by far more stable.

In a terminal run mysql approx. like this:

Code: Select all
c:/xampp/bin/mysql -u username -ppassword databasename <exportfile.sql


Be carefully, as you can see, there is a space between "-u" and username, but there is NO space between "-p" and password - thats weird, but correct! If your exportfile.sql (replace with the real file name) already applies a database (you would find a "USE database;" somewhere in the top, you might omit the databasename in the command. There MUST NOT be a space between "<" and the exportfile.sql.

That command will run by far faster than phpmyadmin and its by far more stable. If you use Xampps default setup and apply "root" as Username and leave out the -p Option with passwort (as Password is empty on default installation).