MySQL Workbench 6.1 syntax errors in every statement - mysql-workbench

If I open up MySQL Workbench 6.1 on Ubuntu 14.04, and try to execute even a simple statement like
UPDATE articles SET published = 1;
It throws a syntax error when using the explain option:
Error executing explain
("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 'UPDATE articles SET published = 1' at line 1", 1064)
I know there is no syntax error because I can copy and paste that exact statement into MySQL command line and it works.
Select statements are fine, but not updates or inserts. I have no idea what's wrong and it's incredibly frustrating.

Related

run \dt in oracle sqldeveloper for PostgreSQL

I configured PostgreSQL for Oracle SQL developer.
I just tried to run the command \dt; from the worksheet and received below error
Error starting at line : 1 in command -
\dt
Error report -
SQL Error: ERROR: syntax error at or near "\"
Position: 1
Could you please advise how to run the commonly used psql commands from worksheet in Oracle SQL developer.
Edit1:
Are there any alternative equivalent for such psql command for oracle sql developer please. Thanks.
Doesn't SQL Developer offer a GUI view that provides the same info as \dt does? That is its job, afterall, and the point of using a GUI.
You can start psql with the -E option, then it will show you the SQL it executes to get the data behind the various backslash commands. You can then capture and run those queries in something else, like (presumably, I haven't tried it) SQL Developer.
You cannot do that.
psql commands are only available in psql.
Consider using psql, it is superior.

Install4j - Is it possible to run TSQL queries?

When working with Server-Sql, sometimes it needs to use Transact-SQL queries. Is it possible to execute it through Install4j?
EDIT
I'm using the Server SQL JDBC driver: - com.microsoft.sqlserver.jdbc.SQLServerDriver.
When I'm trying to execute the following script in the SSMS it works without any problem:
USE [${installer:DbName}]
GO
CREATE USER [Guest] FOR LOGIN [Guest]
GO
USE [${installer:acDbName}]
GO
ALTER ROLE [db_owner] ADD MEMBER [Guest]
GO
, but when executing it with the "Execute SQL script" I get the following error: com.install4j.runtime.beans.actions.jdbc.ExecuteSqlScriptAction [ID 8123]: Error executing script line "U", error message: "Could not find stored procedure 'U'."
When enabling the statement delimeter with ; I'm getting the next error:
"Incorrect syntax near 'GO'."
It depends on whether the JDBC driver that you are using can handle TSQL or not, install4j does not have support for specific databases.

using executable in Liquibase changesets

I am using execute command tag from my liquibase changesets and this inturn is configured to run the sqls in oracle instant client sql plus.
when i run a liquibase update on my changelogxml everything works fine and the liquibase update is sucessfull.I can see the changes to the table also.
But when i try to fail the update process by giving a syntax error in my sql file refered in the changeset.Liquibase still returns liquibase update sucessfull.I expected it to throw sql errors.The sql when run seperately in toad throws syntax error.What should i do to get the error displayed out.?
Datical has created a custom Liquibase change tag that executes SQL using the sqlplus command line client. It was surprisingly much more complicated that you might think.
Some of the issues we had to deal with:
we had to do things to ensure that the sql files always had certain statements in place, and never had certain other statements. This might include things like setting the schema, ensuring that the only spool commands were ones we knew about, that the script had an 'EXIT' command, and ensuring that whenever there was a SQL error that the exit code was returned.
The sqlplus executable does not return an exit code (i.e. a non-zero exit code form the native process) in all cases, and instead will write errors to an error table in the database. The table where sqlplus writes errors is called sperrorlog, and this may be what you will need to look into.
I can't really go into all the details, but just know that what you are attempting to do is neither simple nor straightforward.

Describe command in DB2 data studio

My new Project is using DB2 9.7 version, and the GUI used is Data Studio. But the basic Describe command is not recognized. The query I am using is:
DESCRIBE table Select * from risk.risk_basic
and the error am getting is :
unexpected token "DESCRIBE Select *" was found following
"BEGIN-OF-STATEMENT"
As #data_henrik wrote it is a command and cannot be executed through a JDBC connection. YOu could switch the editor connection to a DB2 Server Command Line Processor though ...
This is described in the following answer of mine
https://dba.stackexchange.com/questions/161117/reorg-command-does-not-work-in-ibm-data-studio-but-same-works-in-command-line-pr

SQL injection error with backslash

I've been trying to search for an explanation here and on google for some real answer, but havent found any thread so here it goes..
Im trying to inject some vulnerable code into a parameter on my dummy server, however the sanitation works fine, so it does not give an error with ' or ''
after the id login.asp?id= however, when i just use \ to inject after the id parameter, it gives the following error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[MySQL][ODBC 5.3(a) Driver][mysqld-5.5.47]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
/usr/login.asp, line 31
Is this a false positive? How can it give an error with a backslash and not while i use either ' '' 1=2 etc only with the blackslash..
Can someone explain why this happens and can an attacker exploit this, because i manually tried to exploit it but it didnt work.