MySQL Forums
Forum List  »  Newbie

Re: escaped character problem
Posted by: Wim Roffel
Date: October 02, 2018 01:03PM

The data was exported with phpmyadmin. Below you find a complete copy of the dump. I have only reduced the data section a bit.

-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Oct 02, 2018 at 03:44 PM
-- Server version: 10.1.30-MariaDB
-- PHP Version: 5.6.33

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `snoeptb`
--

-- --------------------------------------------------------

--
-- Table structure for table `ps_address`
--

CREATE TABLE `ps_address` (
`id_address` int(10) UNSIGNED NOT NULL,
`lastname` varchar(32) NOT NULL,
`firstname` varchar(32) NOT NULL,
`address1` varchar(128) NOT NULL,
`address2` varchar(128) DEFAULT NULL,
`postcode` varchar(12) DEFAULT NULL,
`city` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ps_address`
--

INSERT INTO `ps_address` (`id_address`, `lastname`, `firstname`, `address1`, `address2`, `postcode`, `city`) VALUES
(2, 'DOE', 'John', '16, Main street', '2nd floor', '75000', 'Paris '),
(5, 'Smith', 'Hein', 'Montari 98', '', '6047 PM', '\'s-Heerenberg'),
(5, 'Johnson', 'Dwayne', 'Gratman 12', '', '1144 PD', 'Woerden');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `ps_address`
--
ALTER TABLE `ps_address`
ADD PRIMARY KEY (`id_address`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `ps_address`
--
ALTER TABLE `ps_address`
MODIFY `id_address` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4905;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

*******************************************************************
The error message is below. Note that what is mentioned with "near" is always the next command. So if you have a big dump that results in ore than one INSERT command then the next INSERT command is mentioned.

Static analysis:

1 errors were found during analysis.

No transaction was previously started. (near "COMMIT" at position 683)
SQL query:

INSERT INTO `ps_address` (`id_address`, `lastname`, `firstname`, `address1`, `address2`, `postcode`, `city`) VALUES (2, 'DOE', 'John', '16, Main street', '2nd floor', '75000', 'Paris '), (5, 'Smith', 'Hein', 'Montari 98', '', '6047 PM', '\'s-Heerenberg'), (5, 'Johnson', 'Dwayne', 'Gratman 12', '', '1144 PD', 'Woerden'); -- -- Indexes for dumped tables -- -- -- Indexes for table `ps_address` -- ALTER TABLE `ps_address` ADD PRIMARY KEY (`id_address`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `ps_address` -- ALTER TABLE `ps_address` MODIFY `id_address` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4905; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

MySQL said: Documentation

#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 'ALTER TABLE `ps_address`
ADD PRIMARY KEY (`id_address`);

--
-- AUTO_INCRE' at line 13

Options: ReplyQuote


Subject
Written By
Posted
October 02, 2018 08:37AM
October 02, 2018 09:59AM
Re: escaped character problem
October 02, 2018 01:03PM
October 02, 2018 02:30PM
October 04, 2018 06:36AM
October 04, 2018 08:22AM
October 07, 2018 02:05PM
October 07, 2018 03:27PM
October 02, 2018 02:14PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.