OpenCart on Windows XP Error - mysql

I'm trying to install Open Cart on my virtual machine with, PHP 5.4.7, MySQL 5.5 and Apache 2.2. After A LOT of troubles, I've managed to arrive at the moment of installation script execution, but I receive this problem:
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 '/*!40101 SET #OLD_CHARACTER_SET_CLIENT=##CHARACTER_SET_CLIENT */' at line 1
Honestly I'm stuck. I've tried to execute the code in Workbench and it works, except that in the INSERT INTO queries for test data they've missed default values for NOT NULL columns.
Hints? Suggestion?

Those random characters at the start of the SQL are the UTF Byte Order Mark. Something you used to edit the file decided to emit that at the start. Quickest way to get rid of it would be getting Notepad++, open the file in that, Select "Encoding->Enocde in UTF-8 without BOM", and resave the file, and try again.

Related

MySQL Workbench / Forward Engineering Progress - Error

So i have a little problem while learning MySQL/PHP.
I have installed XAMPP and the MySQL Workbench, in order to learn (play around) some basic SQL/PHP stuff.
My XAMPP shows that my SQL server is up and running (it clearly says MySQL), but nonetheless, i get an error, each time i try to implement a schema on my sql-server.
As for now, i have only used the EER/Forward Engineering method of implementing a database with the MySQL-Workbench. Each time i try to complete the process after modelling the EER model, i get errors like this:
Executing SQL script in server
ERROR: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')
Does anyone here have an idea how to fix this?
Greetings.
Thats what the generated SQL looks like
I also tried setting the "Target SQL Version" in the Model preferences to 5.6, as well as overall preferences.
As a little desperation move, i deinstalled XAMPP and the MySQL Workbench, and installed the newest versions - XAMPP (7.3.8 , using MariaDB) and the Workbench (8.0.17)
What am i missing?

PHPMyAdmin has retained a bad query I typed as the default "browse" query

Yesterday I typed a bad query into the SQL box of PHPMyAdmin.
Ever since, when I click on my database table in the bar on the left, or click the Browse button, my query is used as the default query. Or rather the part I typed at the end is added to every query.
I get an error dialog reading
#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 'offset1000
LIMIT 0, 30' at line 1
which is my bad query. How can I get rid of this? Is there a cache with this query in it somewhere?
Details: PHPMyAdmin 4.0.10deb1ubuntu0.1 / Apache/2.4.7 (Ubuntu) / Ubuntu 14.04.1 and yes, I've logged out and even rebooted the server.
I have found the answer to this after a lot of searching.
PHPMyAdmin 4 has a table for this helpful feature.
It's in the database phpmyadmin, table pma_table_uiprefs. Stored against my username, that table and database was the bad query. I deleted it, which didn't help right away, but when I logged out and back in, it was gone.

Import database backup return #1064

Suddenly importing database backup returns the error below.
The odd thing is that importing an old working copy it works.
If I export it straight afterwards and I try to re-import it the file gives this error.
Looks like it's PhpMyAdmin export that causes issue.
Is there any change in PhpMyAdmin export process that I'm not aware of?
This looks like my problem but the solution didn't work for me.
There is a chance that you may have found a bug in the SQL parser.
Please examine your query closely, and check that the quotes are
correct and not mis-matched. Other possible failure causes may be
that you are uploading a file with binary outside of a quoted text
area. You can also try your query on the MySQL command line interface.
The MySQL server error output below, if there is any, may also
help you in diagnosing the problem. If you still have problems or
if the parser fails where the command line interface succeeds, please
reduce your SQL query input to the single query that causes problems,
and submit a bug report with the data chunk in the CUT section below:
----INIZIO CUT----
eNo1jU0KwjAYRIXuvlPMAWIw0SrNLoTQLvJn0roXF1IQ3Sjo7U0FZ/UYHjM255gVjICRcDYoCEgI
QWWsdUPkP+XoFFou+L5b3x5XmkpGLAy6t2FkONkq+vMFZsjR22puuOwoea2wq9xSGtJisViWnS0X
B7j5/nqT06FXmJ/0u6Bm9c8XSs4hPQ==
----FINE CUT----
----INIZIO RAW----
ERROR: C1 C2 LEN: 1 2 11
STR: MySQL: 5.1.69-log
USR OS, AGENT, VER: Mac CHROME 5.0.29
PMA: 4.0.5
PHP VER,OS: 5.3.17 Linux
LANG: it
SQL:
----FINE RAW----
Query SQL:
Messaggio di MySQL:
#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 '' at line 1
(I translated what I could in the error as my phpmyadmin is in Italian)
I had the same problem and I found the solution. Open the sql document with any code editor and at the very end in the last line you will see some black strange codes just delete and save should work as it worked for me.
I'm not sure how and why this code been generated when I exported my database.
You are running an outdated phpMyAdmin version. I believe that the fix mentionned in https://sourceforge.net/p/phpmyadmin/bugs/4095/ (for the upcoming 4.0.8 version) will help you.
Direct link to the fix (can be applied to 4.0.7): https://github.com/phpmyadmin/phpmyadmin/commit/b717657de77db0b58179bdbdd88e23d0fc3d7ea6

Error code 1064, SQL state 42000: You have an error in your SQL syntax;

I'm using latest version of MySQL ==> mysql-5.6.10-winx64.zip
Created the database and every thing is ok 'I think'
when I try to execute this simple command;
"select * from family"
I got this error :
Error code 1064, SQL state 42000: 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 'OPTION SQL_SELECT_LIMIT=DEFAULT' at
line 1
I've spent much time searching for a solution but no solution was found :(
That looks like an error coming from a JDBC driver. When the JDBC driver initializes the connection, it sends several commands to the MySQL server, one of which is:
SET OPTION SQL_SELECT_LIMIT=DEFAULT
The problem is that the SET OPTION syntax has been deprecated for some time and is now no longer valid in MySQL 5.6. Here's a relevant bug conversation from MySQL's bug database:
Bug #66659: mysql 5.6.6m9 fails on OPTION SQL_SELECT_LIMIT=DEFAULT
Try upgrading your JDBC MySQL driver. The bug conversation lists some other options in case upgrading the driver is not an option.
I followed the instructions above and this worked for me!
Download latest jar file from here:
http://dev.mysql.com/downloads/mirror.php?id=412737
Unzip it
Copy jar file "mysql-connector-java-5.1.25-bin.jar"
to this folder: C:\Program Files\NetBeans 7.3\ide\modules\ext
In Netbeans IDE: Disconnect from database.
Click Services. Expand Drivers. Right-click on MySQL and press Customize.
Add latest driver
Remove previous driver.
Re-connect to dabatase within IDE.
I had the same problem few weeks back. Followed the following steps and it very much resolved the issue.
Copied the latest version (mysql-connector-java-5.1.23-bin) of the jar file to ..\NetBeans 7.3\ide\modules\ext. My earlier version of the driver was mysql-connector-java-5.1.18-bin.
Change the driver version within NetBeans IDE. In the IDE's Services window, expand Drivers -> right-click on MySQL (Connector/J driver) and select Customize. Remove the earlier driver and point it to the latest one (C:\Program Files (x86)\NetBeans 7.3\ide\modules\ext\mysql-connector-java-5.1.23-bin.jar). Click ok and restart IDE.
This should resolve the problem.
If the driver suggestion does not work, check your sql for unprintable characters. I just spent an hour troubleshooting this issue only to discover a hidden u+200b character at the end of my sql statement.
I got the same Error when i was dumping mysql table structure file in to DB. Mistake was putting the Syntax for dropping all table before but not checking their existence in the Database.
Issue was at " DROP TABLE usermgmt".
I removed that code of lines of dropping tables and it proceeded with out any error this time.
I prefixed the name of the table with the database name such as
select * from database_name.table_name;
and it worked perfectly, so most likely there's a name conflict.

How to bulk insert a csv file?

BULK INSERT krissmall
FROM 'C:\Users\Administrator\Downloads\misskrisdata_small.csv'
WITH (FIELDTERMINATOR = ',', ROWTERMINATOR = '\n')
ERROR 1064 (42000): 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 'BULK
INSERT krissmall FROM 'C:\Users\Administrator\Downloads\misskrisdata_small.' at
line 1
Can someone please tell me where went wrong? Or some other reasons behind this. I stared at this query for a long time, and looked it up a lot but I cannot find where it is wrong.
I'm curious where you looked up BULK INSERT since that doesn't seem to be supported by MySQL at all. Maybe you're reading MS SQL documentation and confusing the two.
What you want is LOAD DATA INFILE which can parse CSV.
You tagged phpmyadmin which leads me to believe that you are trying to execute this query from a remote server (possibly a web host). The remote server can't connect to your local drive. You must import through phpMyAdmin or upload the file you wish to import to a directory that phpMyAdmin can see.