MySQL Workbench / Forward Engineering Progress - Error - mysql

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?

Related

ADO Error: 0x80040e14 exception occurred in microsoft oledb provider for odbc drivers[ODBC 8.0(a)][mysqld-8.0.20] You have an error in your SQL syntax

We have built RFID based system identification application in LabView using MySQL as database.
We have one same software running on two similar computers. Few months before application was running properly on both the computers. Now one is running smoothly but the second one gives following error.
ADO error: 0x80040e14 exception occurred in microsoft ole db provider for odbc drivers [MYSQL] [ODBC 8.0(a)] [mysqld-8.0.20] You have an error in your SQL syntax; check the manual corresponds to your MySQL version for the right syntax yo user near "RFID_tag_number' at line 1 in NI_Database_API.lvlib:Conn Execute.vi...till path of the file.
As you can see there is double inverted comma before RFID_tag_number in the error, but in our code we have only used single inverted comma as it is a string value. We tried to copy complete application from the computer where it is properly running to the second computer but still getting the same error.
The only difference between both computers we found is -
In the computer running properly - In MySQL Workbench >Administrator >Server Status, the Configuration Path is My SQL Server 5.7\my.ini
And in the second computer it is My SQL Server 8.0\my.ini.
We don't know if this is the reason for the error or how the configuration path affects the application. We even tried to remove MySQL server 8.0 completely from computer with the issue and installed MySQL server 5.7 but still the path remained same.
Can anyone help us? We are new to LabView working with MySQL.
What I understand, error will throw for incorrect query,it might be required handling special characters.
Second if same data base access by both system
,system required same version my mysql and odbc driver also.
Third, when you try to remove mysql, delete hidden files in c drive then install new version

Sql Syntax error with Doctrine, probably because of change of Mysql version

I've programmed a project in symfony and mysql 5.6. then I uploaded my project to a remote server on 1&1. the remote server has mysql 5.7 version. All doctrine queries run ok and without problem. But when a user searches something, a request will be sent to the server and a doctrine query will be executed. Here it returns the following error:
SQLSTATE[42000]: Syntax error or access violation: 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 'integer)
BETWEEN 1940 AND 2002) AND u0_.id <> 2' at line 1
I think, it is probably because of different versions of mysql. Because on localhost it runs without problem
Can you please help me how to solve it? is there a way to regenerate all the migrations according the new mysql version? or may be there is another solution?
thanks
I was using CAST('number' as integer) in mysql 5.6. It did ok. However in mysql 5.7 and I do not know why, it does not run ok. So I changed it to CAST('number' as UNSIGNED) and it works ok

Importing database SQL syntax error in Prestashop

I'm developing a simple eshop to a French client (I'm Portuguese) at PRESTASHOP, everything went marvellous but we faced some issues when configuring the Payment System ATOS. We were using VIADUC.fr services, and due to those issues we have recently changed to OVH.
Problem: OVH offers a database, and now when I'm trying to import my database I have the following error:
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 './PaxHeaders.7074
OVH help me to find what the issue was, but can't help solve it because this "goes out of their scope", and I have really tiny experience with this.
The eshop has been delayed because of this matter and i can't delay it much longer.

How to fix a MySQL syntax error when deploying a working Play application to CloudBees?

I have very simple Play application that illustrates the use of MySQL (rather than the default H2) database available here:
https://github.com/ics-software-engineering/play-example-mysql
The README file explains the steps required to run the application locally using a local installation of MySQL. It works fine locally.
I have been trying unsuccessfully to get this application to work on CloudBees. My basic strategy has been:
Use the CloudBees Play 2 ClickStart to create a sample app, db, repo, and build system.
Edit the build file to refer to my github repository.
Rebuild and redeploy.
More complete instructions on this strategy are available here.
When I go through this process, the system builds and deploys, but gets a MySQL syntax error in the application console when I attempt to retrieve the home page:
[ [37minfo [0m] play - database [default] connected at jdbc:mysql://ec2-23-21-211-172.compute-1.amazonaws.com:3306/play-example-mys
[ [31merror [0m] play - 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 'sequence page_retrieval_seq' at line 1 [ERROR:1064, SQLSTATE:42000]
Oops, cannot start the server.
#6f3k8cj6c: Database 'default' is in inconsistent state!
at play.api.db.evolutions.Evolutions$.checkEvolutionsState(Evolutions.scala:177)
This is a curious error because the syntax error "sequence page_retrieval_seq" is quite similar to one of the lines generated by Play in 1.sql when the database is the default (H2):
create sequence page_retrieval_seq
Unfortunately, this line is not actually in my 1.sql file, and I do not get this error when I run the system locally. I am running MySQL Ver 14.14 Distrib 5.6.12, for osx10.7 (x86_64).
I recognize that for production use, it is not advisable to enable automatic evolutions, but that is not the problem I want to solve here. My goal is for the CloudBees application to provide a snapshot of the latest working version of the code, and for evolutions to work on CloudBees MySQL just like they work for my local MySQL installation.
I have tried the steps outlined in this answer but it does not work on CloudBees, and anyway my current code already works correctly on a local installation of MySQL.
Why does my simple Play application not deploy correctly on CloudBees, and how can I fix it?
There appears to be a problem with play running evolutions incorrectly when ebean involved when running play in "production mode"
https://github.com/playframework/playframework/issues/1410
I have tested evolutions and they work even in production mode as long as ebean isn't used.
In any case, running evolutions in a production app is less than advisable, which is probably why this bug hasn't been picked up until now.
I updated the docs: https://developer.cloudbees.com/bin/view/RUN/Playframework with info on connecting to the database from anywhere, so you can run evolutions from the desktop or from Jenkins etc.
So run in something closer to play framework prod mode run "play start" to see this behavior for yourself.
Also, it appears JPA has wider use for ORM: https://github.com/typesafehub/play-spring-data-jpa
EDIT: Yeah im wrong, mis-read!
====================
As far as I know MySQL does not support sequences.
http://dev.mysql.com/doc/refman/5.6/en/faqs-general.html#qandaitem-B-1-1-6
mysql> create sequence test;
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 'sequence blag' at line 1

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.