By passing triggers in MySQL - mysql

I want to disable triggers while executing an update statement as it throws an error
[Err] 1172 - Result consisted of more than one row
I tried two solutions,
MySQL disable all triggers
http://www.ehow.com/how_12078894_bypass-triggers-sql.html
But none seem to work, I get the same error in the first case and in the second case I get a syntax error.
Error in 2nd case:
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 'TRIGGER ALL'
Any Suggestions?

Related

How to resize mysql> innodb_temp_data_file_path = ibtmp1:12M:autoextend:max:5G;? Using Mysql 8.0

I tried to resize in many different ways but I always get the same error:
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 'innodb_temp_data_file_path=ibtmp1:12M:autoextend:max:500M' at line 1
As mysql manual on sysvar_innodb_temp_data_file_path says, it is not a dynamic variable, therefore cannot be set using set sysvar_innodb_temp_data_file_path=... method via sql. You need to include it either in your mysql config file or as a startup parameter to the mysql service.

Update ERROR Mysql

UPDATE User SET username='basta2',password=sha2('basta',512), role='User' disabled=0 WHERE username='basta';
This query should be correct in my opinion, but gives me this error
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 'disabled=0 WHERE username='basta'' at line 1
What is wrong here?
As pointed by #vkp, the issue is a missing ,. Use this:
UPDATE User SET username='basta2',password=sha2('basta',512), role='User', disabled=0 WHERE username='basta';

Can't find out what's wrong with this MySQL event syntax

I'm trying to create a MySQL event, and this is the syntax I'm using:
CREATE EVENT test
ON SCHEDULE AT FROM_UNIXTIME(1428005286)
DO
BEGIN
UPDATE blog_posts SET status = 'published' WHERE id = 5;
END
When I run it on Node.js (with the mySQL adapter, under Sails.js), I get no error, but the event doesn't get created. When I run it directly through phpMyAdmin, I get:
#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 5
I have also tried adding a semicolon to END, making it END;, and removing all semicolons, and it returns a slightly similar error:
#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 'END' at line 6
I have no idea why this is happening. Any help is appreciated. Thanks.
You probably need to start with: create DEFINER=root#localhost ...
Also, since this is a one-liner, you don't need BEGIN..END

PHPMyadmin backslash on query

I cannot run sql queries to phpMyAdmin because every time I try to run a query (Update or Insert ) backslashes are added before quotes or double .
Example:
update bareme set code_fam='loa' WHERE code=159
I get the following error message:
There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem
ERROR: Unknown Punctuation String # 31
STR: =\
SQL: updatebaremesetcode_fam=\'loa\' WHEREcode=159
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 '\'loa\' WHERE code=159' at line 1
magic_quotes_gpc=on;
magic_quotes_runtime=off;
magic_quotes_sybase=off;

Can't create a view using the views module

I created a view using Views module based on the default node index. But the first thing I found is this error message:
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 '-1 OFFSET 0' at line 2
What might cause this and how do I solve it?
You have an error in your SQL syntax !
View module just GUI for create query
so you be sure your choice was Logical for create a query