Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MYSQL


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Couldn't Execute '/*!40100 SET @@SQL_MODE='' */': Query Was Empty (1065)


I upgraded to MySQL 5.0, but the remote server still runs 3.23. Before I upgraded I was able to, in a local DOS-prompt, execute a mysqldump and get the database from the server to a file on my computer. Now, when I execute the same query, the remote server does not understand my command.

This is what I execute on my local computer (simplified):
C:foldermysqldump --add-locks --add-drop-table -h xx.xx.xxx.xx -u username -p database > "C:folderdb_downloaded.sql"

This used to work, but after I upgraded I get the error message:
Couldn't execute '/*!40100 SET @@SQL_MODE='' */': Query was empty (1065)




View Complete Forum Thread with Replies

Related Forum Messages:
Set Global Sql_mode=”;
This is been troubling me for a while - i found out how to do SET GLOBAL SQL_MODE=”;

But i can not find a solution how to undo the SET GLOBAL SQL_MODE=”; ?

Tried few things none worked - even re-installed MySQL5.


View Replies !
The Meaning Of This: /*!40100 SET CHARACTER SET Latin1*/
MySQL dumps contain many comments such as this:

/*!40100 SET CHARACTER SET latin1*/

I understand that /* */ are comments, but what is the meaning of !40100 ?

View Replies !
Execute Time Of A Query
I'm running a SELECT * query on a table with over 3,000 rows. I need to know the execute time on the query.

PHPMyAdmin shows it to me, but because they automatically add a LIMIT 0, 30 I suspect the time is only for those 30 records. It also has a feature to prevent web server timeouts that prevents me from setting the LIMIT to 0, 3100.

BTW, I'm programming in PHP. Does the time to run the query get automatically passed when PHP sends the query to MySQL?

<? PHP
$Query = "select * from my_table where 1";
$Result = MYSQL_QUERY($Query);
?>

View Replies !
How To Execute A Query From A File In OS X Leopard
I want to execute a query from within a file in OS X Leopard. The syntax (according to what I could find on the web) should be:

mysql> . /Users/peterv/bin/test.sql;

but it gives me this error:
ERROR:
Failed to open file '/Users/peterv/bin/test.sql;', error: 2

The file has the correct permissions.

View Replies !
Average Query Execute Time???
I have a query taking about 4 sec that gets only 18 records.. That's not good. What can I do to speen up my Query?
<CFQUERY DATASOURCE="#datasource#" NAME="qry_job_search">
SELECT DISTINCT (t1.JobPostId), t1.Actionlkp, t1.Date,
tbl_job_posting.*,
tbl_job_post_requirements.*,
tbl_employer_info.*,
tbl_employer_url.*,
tblkp_employment_type.*,
tblkp_education_exp_lvl.*,
tblkp_salary_range.*,
tblkp_employment_exp_lvl.*,
tbl_job_post_location.*,
tbl_job_post_job_categories.JobCat,
tblkp_countries.*,
tblkp_prefectures.*
FROM tbl_job_post_history AS t1
JOIN tbl_job_post_location
ON tbl_job_post_location.JobPostID = t1.JobPostID
JOIN tblkp_countries
ON tbl_job_post_location.CC1 = tblkp_countries.CC1
JOIN tblkp_prefectures
ON tbl_job_post_location.CC1 = tblkp_prefectures.CC1
AND tbl_job_post_location.PrefectureID = tblkp_prefectures.ADM1
LEFT JOIN tbl_job_post_requirements
ON tbl_job_post_requirements.JobPostID = t1.JobPostID
LEFT OUTER JOIN tbl_job_post_job_categories
ON tbl_job_post_job_categories.JobPostID = t1.JobPostID
JOIN tbl_job_posting
ON tbl_job_posting.JobPostID = t1.JobPostID
JOIN tbl_employer_info
ON tbl_employer_info.UserID = tbl_job_posting.UserID
LEFT JOIN tbl_employer_url
ON tbl_employer_url.EmployerID = tbl_employer_info.EmployerID
JOIN tblkp_employment_type
ON tblkp_employment_type.ID = tbl_job_posting.EmploymentType
JOIN tblkp_education_exp_lvl
ON tblkp_education_exp_lvl.ID = tbl_job_posting.EducationExpType
JOIN tblkp_salary_range
ON tblkp_salary_range.ID = tbl_job_posting.Salarylkp
JOIN tblkp_employment_exp_lvl
ON tblkp_employment_exp_lvl.ID = tbl_job_posting.EmploymentExpType
WHERE t1.JobPostId NOT
IN (
SELECT DISTINCT (JobPostId)
FROM tbl_job_post_history
WHERE Actionlkp =4
AND date = (
SELECT MAX( date )
FROM tbl_job_post_history
WHERE JobPostId = t1.JobPostId )
AND JobPostID = t1.JobPostID
)
AND HistID = (
SELECT MAX( HistID )
FROM tbl_job_post_history
WHERE JobPostID = t1.JobPostId
AND Actionlkp =1
)
AND Date >= ( curdate( ) - INTERVAL 30 DAY )

<CFIF SESSION.COUNTRY_A NEQ "" AND SESSION.PREFECTURE_A EQ 0 AND SESSION.CITY_A EQ "">
AND tbl_job_post_location.CC1 = '#SESSION.COUNTRY_A#'
<CFELSEIF (SESSION.COUNTRY_A NEQ "" AND SESSION.PREFECTURE_A NEQ 0 AND SESSION.CITY_A EQ "") OR FORM.PREFECTURE NEQ 0>
AND tbl_job_post_location.CC1 = '#SESSION.COUNTRY_A#'
AND tbl_job_post_location.PrefectureID = '#SESSION.PREFECTURE_A#'
<CFELSEIF SESSION.COUNTRY_A NEQ "" AND SESSION.PREFECTURE_A NEQ 0 AND SESSION.CITY_A NEQ "">
AND tbl_job_post_location.CC1 = '#SESSION.COUNTRY_A#'
AND tbl_job_post_location.PrefectureID = '#SESSION.PREFECTURE_A#'
AND tbl_job_post_location.PostCity LIKE '%#SESSION.CITY_A#%'
</CFIF>
<CFIF (SESSION.CATEGORY_A NEQ 1) OR FORM.CATEGORY NEQ "">
AND tbl_job_post_job_categories.JobCat = '#SESSION.CATEGORY_A#'
</CFIF>
<CFIF (SESSION.KEYWORD NEQ "") OR FORM.KEYWORD NEQ "">
AND t1.Actionlkp = 1
AND (tbl_job_posting.JobTitle
LIKE '%#session.Keyword#%'
OR tbl_job_posting.JobDescription
LIKE '%#session.Keyword#%'
OR tbl_job_post_requirements.JobRequirements
LIKE '%#session.Keyword#%')
<CFIF SESSION.KEYWORD NEQ "" AND SESSION.PGV NEQ "brief">
<CFSET SESSION.PGV = "detailed">
</CFIF>
</CFIF>
<CFIF SESSION.EMP_TYPE_A NEQ 1>
AND tbl_job_posting.EmploymentType = '#SESSION.EMP_TYPE_A#'
</CFIF>
<CFIF SESSION.EXP_LVL_A NEQ 1>
AND tbl_job_posting.EmploymentExpType = '#SESSION.EXP_LVL_A#'
</CFIF>
<CFIF session.SRT EQ "D">
ORDER BY Date DESC
<CFELSEIF session.SRT EQ "C">
ORDER BY tbl_employer_info.CompanyName
<CFELSEIF session.SRT EQ "L">
<CFIF form.country NEQ 0>
<CFIF form.prefecture NEQ 0>
<CFIF form.city NEQ 0>
ORDER BY tbl_job_post_location.PostCity
</CFIF>
<CFELSE>
ORDER BY tblkp_prefectures.FullNameS, tbl_job_post_location.PostCity
</CFIF>
<CFELSE>
ORDER BY tblkp_countries.CC1, tblkp_prefectures.FullNameS, tbl_job_post_location.PostCity
</CFIF>
<CFELSEIF session.SRT EQ "T">
ORDER BY tbl_job_posting.JobTitle
</CFIF>
</CFQUERY>
Can anybody see a shortcut to get the same results??

View Replies !
Possible To Execute A Saved Query From Within Another Query?
Does MySQL provide a way to refer in a query to stored query instruction as if it were an existing table, in such a way that the stored query is exected when the query that refers to it is executed?

View Replies !
'Copy To Tmp Table' Is Taking For Ever To Execute A Query
We have a query when run on large systems, it takes for ever to return the results. When we execute the query we notice that it takes a very long time in state - 'Copy to tmp table' but server doesn't get hung. Eventually it will return the data.

Following is the query:...

View Replies !
Query Returns Empty Set
i have this query:
Code:

select p.url,s.tipo,pw.url as wrapper from secciones s
join plantillas p on s.plantilla=p.clave
join plantillas pw on p.wrapper=pw.clave
where s.clave=1

it works fine, the problem is that from time to time the second join condition won't match, because by design the field p.wrapper is optional, if that happens the query returns 'empty set' even if the where condition and the first join condition do match, is it possible to modify that query so it needs to match only the first join and the where clause to return the result set (i.e. make the second join optional)?

View Replies !
Error:Query Was Empty
What could be the cause of the above error
message to appear along with my error echo messages.

View Replies !
Empty/NULL Query Or State
When running SHOW FULL PROCESSLIST (or mytop) we're seeing huge numbers of empty queries.

Example:
http://pastie.caboo.se/pastes/201976

When checking out the Info column, both it and the Query/State fields are NULL.
These huge spikes of empty queries also correspond with a major slowdown of our server so it leads me to assume that the empty queries have something to do with our server speed issues.
Any ideas why we're seeing so many empty queries and what we might can do to fix it?
We're running MySQL 5.0.51b.

View Replies !
Empty Value In Multi Table Query
MySQL
SELECT p.`desc`,
IF(SUBSTRING(p.prodCode,1,3)='p1-',(SELECT p2.nPrice FROM tProducts p2 WHERE p2.prodCode=SUBSTRING(p.prodCode,4) LIMIT 1),0) as normalPrice,
COUNT(DISTINCT pic.ordering) as pic_count
FROM
tProducts p
JOIN prod_subCats psc ON p.productID=psc.relProdId
LEFT JOIN taxCodes tax ON p.taxCode=tax.taxCode
LEFT JOIN suppliers s ON p.supplierID=s.supplierID
LEFT JOIN pictures pic ON p.productID=pic.relProdId
LEFT JOIN freeProducts fp ON p.productID = fp.productID
LEFT JOIN tProducts freeProd ON fp.freeProductID=freeProd.productID
LEFT JOIN pictures freePic ON freeProd.productID=freePic.relProdId
LEFT JOIN prodReviews review ON p.productID=review.productID AND review.status=1

WHERE p.stocklevel>-3 AND psc.relSubCatId=7235
GROUP BY p.productID
LIMIT 1

The value p.`desc` comes up blank (not null, just blank) in this query, though I know this data is there.
If I remove either of the other 2 fields for the query, the correct data for field p.`desc` is returned.
This kind of thing would normally happen when you specify fields with the same name from different tables, either explicitly, or using *. But as far as I can tell, all my fields & tables are correctly aliased etc
To further confuse matters, this problem occurs on my (windows) development server running v4.1.1, but not the (linux) production machine running v 4.1.2
I'm stumped.

View Replies !
Fill In Empty Months In Query
I have a query to grab some order info which gives me:

Code:
yearMonth orderMonth ordersPerMonth
----------------------------------------------------------
2006-12121
2007-112
2007-221
2008-661
I was hoping to somehow pad out the empty months like so:

Code:
yearMonth orderMonth ordersPerMonth
----------------------------------------------------------
2006-12121
2007-112
2007-221
2007-330
2007-440
2007-550
2007-660
2007-770
2007-880
2007-990
2007-10100
2007-11110
2007-12120
2008-110
2008-220
2008-330
2008-440
2008-550
2008-661
2008-770
2008-880
2008-990
2008-10100
2008-11110
I'm running 4.1.22 and the query is:

MySQL Code:
SELECT CONCAT(YEAR(ordDate),'-',MONTH(ordDate)) AS yearMonth,
        MONTH(ordDate) AS orderMonth,
        COUNT(*) AS ordersPerMonth 
FROM orders
WHERE ordUserID = 10
AND ordDate > 2006-12
GROUP BY MONTH(ordDate)
ORDER BY yearMonth

View Replies !
Error 1605 : Query Was Empty Please Reply
when I am restoring the database on local machine.

using command :

mysql -u username DatabaseName < pathForResotoreFile -p password.

I am getting error -> "Error 1605 : Query was empty" on line 7 in back up file.

When i checked the backup file at line 7 there are comments.

View Replies !
Query With Subquery Variably Returns Empty Result Set
I have a rather uncomplicated query that will randomly returning an empty result set even though I know there are valid records.

Here's the query: .....

View Replies !
What's Wrong With My Query To Filter Double Entries And Skip Empty Rows?
I am trying to get filter a database table.
- skip empty rows (i.e. ecardNameSender is empty)
- filter double entries

$sql = "SELECT COUNT(*) as total FROM tblEcards WHERE ecardNameSender != '' GROUP BY ecardEmailFriend";
$result = @mysql_query($sql, $connDB);
$row = mysql_fetch_assoc($result);
$totalPics = $row['total'];
echo $totalPics;
What's wrong with my query?

View Replies !
DBD::mysql::st Execute Failed: Lost Connection To MySQL Server During Query
I am using perl to connect to a database and then pull the rows off of the table one by one to manipulate the data.

If I use a smaller table (~8 MB), I wait for around 20 seconds but then the table values are read just fine. However if I use a larger table (~30 MB), I wait for a while and then I get the message:

DBD::mysql::st execute failed: Lost connection to MySQL server during query

I have tried searching for the solution to this problem and haven't found anything that helps yet. I have changed the values of 'max_allowed_packet' and 'wait_timeout', with no effect.

Any ideas?

View Replies !
How To Ignore "Query Was Empty" Results
Today i just got into a bit of a rage. Both google and mysql search don't tell me what option to set to suppress 'query was empty' errors.

I use multi queries where sometimes there is an empty query (on purpose).

View Replies !
Execute An SQL Doc
on freehostia.com i have my sql document, is there a way i can execute it, from browser without adding php?

View Replies !
EXECUTE Sp_rename
Hi,

im coverting a mssql 2000 databse to mysql and ive good to a road block, that i cant seem to figure out how to get round.

Part of the MSSQL 2000 code is

Code:

EXECUTE sp_rename



And i cant seem to find an equivelant for mysql, i wa wondering if anybody knows of a way to get around this?

All help is greatly appreciated

Thanks Again

Andy

View Replies !
Execute Sql Script
I want to run a sql script (file) from the "mysql >" prompt and not from the command line. Is there any way to do this.

View Replies !
How To Execute A SQL Script
I have successfully installed MySQL 5 and can also connect to the server. The issue is that my developer has sent me a copy of the database in .sql fromat (filename: abc.sql) and I do not know how to execute it so I can extract the tables. Can someone please show me the way?

View Replies !
Execute More Then One Sql Statement
In MSDE I could do this "insert into tbl set fld = 1; insert into tbl set fld = 2". When I try that in MySQl, I get an error (below).

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 '; insert into tbl set fld = 2' at line 1

Does MySQl not support this?

View Replies !
Execute A File
Is there a way to execute an SQL script from a file on disk from within MySQL? For example, I have a file containing a valid SQL script at C:david.sql. From within MySQL, I would like to dynamically execute the script contained within that file. Does there exist the syntax to do the equivalent of EXECUTE C:david.sql? I know I can make david.sql a stored procedure … and then CALL david(). I’ve done that. However, frank.sql happens to contain a CREATE FUNCTION statement, and MySQL won’t let you embed a CREATE FUNCTION statement within a stored procedure. If there’s another way to accomplish that end

View Replies !
Execute Scripts From VB.Net
I want to build a VB.NET update package for an application. So with each new release I want to update the client's database. I work with Stored Procedures, so in order to update the newest sp, I want to run a sql script from VB.NET on the client's pc. It is easy to run normal non-queries, but how do I execute a script?

View Replies !
Execute Trigger
i have created a procedure which generates a trigger on passing the table name to the procedure.

now i want to execute this trigger which is currently stored in a user variable in the stored procedure.

how do i execute the trigger directly from the procedure only or the procedure user variable.

View Replies !
Incorrect Arguments To Execute
i am using the development release of mysql and have a PROCEDURE that
executes a prepared statement. it works fine when i call the procedure
but repeating it multiple times produces an "incorrect arguments to
execute" error.

replacing the prepared statement with a normal statement eliminates the
error.

is this due to the release or is a prepared statement not allowed in the
procedure?

i read somewhere that procedures are precompiled and hence will it be as
fast as calling it multiple times without using the prepared statement?

View Replies !
Execute A Script In MySQL
I am renting space on 2 servers. On one server I created a script with
sql's "create table .., insert into...". Now I want to execute this
script on the second server. What is a syntax?
I tried from telnet:

dbname < file.sql
where dbname is a name of my db and file.sql is a script, but I got
message "syntax error".

View Replies !
Can't Execute Delete With The IN Operator
Lately I have been started using MySQL. I managed to create my
database and tables.

When I wanted to execute the following query:
delete
from adminpages
where parentid IN ( select DISTINCT A.id from adminpages AS A where
A.name='galeries' );

I have received the following error message:
Error Code : 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 'select DISTINCT A.id from adminpages AS A where
A.name='galeries'
(0 ms taken).

View Replies !
Execute Mysqldump Command
I have a file containing the mysqldump command looks like this:

mysqldump -t CPS_Trans Transactions --where:"(TerminalId = 06670002 and .....

I want to know how I can execute that file so that I can output th result to a another text file.

View Replies !
Execute Batch Mode
I want to execute the queries wriiten in a .sql file in a single attempt using the batch process of mysql.Since I don't have a good grip over the database systems, I am confused how should I go for it..

View Replies !
Execute A Script File
I just update mysql server to version 4.1. And I try to use the following command:

source C:/Program Files/MySQL/
MySQL Server4.1/data/wormlibrary/table_image.txt
to execute a sql script file,
but always get error like can't create table....(errno:150)
This command and script file worked fine when I use version 4.0

View Replies !
Execute Script From A Trigger
Is possible to launch an external (php) script from a trigger? (If Yes, I'm looking for an example). Or a trigger can only execute a SQL command?

View Replies !
Execute Script Blocks
Is there any way that I can get code like this to run directly in the MySQL command line client (or similar tool) without using a wrapper proc/function?

DELIMITER $$
BEGIN
-- Example block of script code that uses an IF statement
IF (1 + 1 = 2) THEN
SELECT 'True' AS Message;
END IF;
END
$$


I often want to execute script blocks directly during development when testing out code.

View Replies !
Statement Execute Failed
I am trying to store a binary image into a blob field and I am getting the following error:

DBD::mysql::st execute failed: MySQL server has gone away at ...(file and line number here).

I am following several online tutorials on the subject and each one (different implementations) fail at the execute line. If someone could tell me how to fix this I would greatly appreciate it.
I have already tried commenting out the dbh->disconnect; line and it had no effect.
Here is the code that is failing.


use DBI;


our $dbh = DBI->connect('DBI:mysql:pic_test:localhost','whateveruser','whateverpassword', {RaiseError => 1 });


my $sth = $dbh->prepare("INSERT INTO tbl_files (ImageColumn) VALUES (?)");

open(my $fh, 'input.jpg') or die $!;
read( $fh, $var, -s $fh );

$sth->execute($var);


$sth->finish;
$dbh->disconnect;

I am using MySQL server 5.0 on Windows XP and Active PERL 5.8.8.

View Replies !
Execute Script Daily?
I have a database set up as a membership directory. We would like to get an email if a member has not paid his/her dues in a year. Is it possible to set up something in mysql for it to check the database daily for people who's dues haven't been paid in a year and then execute a script that sends me an email with the names of those people? I know I could write a php script to do it, but it just needs to be executed automatically each day so i'm not sure how to make it happen.

View Replies !
Execute String Statment
I'm making my first stored procedured and I need to execute a statment in a string variable, something like this:
"select name from myTable where code = " + my_variable

View Replies !
Execute Trigger After Commit
i try execute one trigger after COMMIT..

because my trigger call one procedure, and it do one update on table that is driven for trigger

so, the procedure and trigger work in same table

exist one trigger like this:

CREATE TRIGGER upd_check AFTER COMMIT ON acc
FOR EACH ROW
BEGIN
call sermyadmin();
END;

View Replies !
GRANT EXECUTE Not Working 5.1.30?
MySQL 5.1.30 x64 on Vista SP1 x64.

We use MySQL Workbench SE 5.0.29 to generate our schema. The schema has stored functions and procedures. We confirmed that we did set the EXECUTE privilege to the user group for these procedures. We confirmed it by reviewing the forward engineering script and the following statement is present (copy and pasted from WB):

grant EXECUTE on procedure `mytest`.`MyProcedure` to OS1001;

That statement never sets the execute permission (root is running the command). If we run the command manually (i.e. via MySQL Query Browser) it also doesn't work. However, we can set the EXECUTE permission via MySQL Administrator.

View Replies !
Grant Execute Function
I have:

ServerA
ServerB

I forward all connections from ServerA to ServerB (where's MySQL Server) by SSH then when i want remote log in to ServerA i can't log in - Access denied but when i remote log in to ServerB i get logged.

User host: %

But if i add GRANT ALL to user i can login to ServerA and ServerB

User normal privileges:

GRANT EXECUTE ON FUNCTION
GRANT EXECUTE ON PROCEDURE

on tables. How to log in by normal user privileges without adding GRANT ALL?

View Replies !
How Can I Execute *.exe From Table Trigger?
i would like to start an exe or dll once record is updated. If field of interest is updated i would like to call an *.exe with parameters. Is this possible in mySql?

View Replies !
Cant Execute Batch File
Hi new to this but pulled out nearly all my hair with this.
I got the test database open and I want to automate creating the menagerie table ( as in the tutorial ) so I download the textfile save it to c:/ and execute the command source c:/cr_pets_tbl.txt all I get is unable to open file error 22.
I have tried creating my own text file ( windows, notepad ) just containing the following
use test;
create table pets(name varchar(10),species varchar(8),born date);

simple as that then type in the consoe source c:/pets.txt;
unable to open file error 22 or sometimes error 2
tried enclosing filename in " and ' tried source= filename
tried . instead of source but nothing works.
using manual insert command or load data local infile works but not this, HELP.
Malcolm K.

View Replies !
DBD::Mysql::St Execute Failed
DBD::mysql::st execute failed: Duplicate entry '1-2070395153-0000-00-00' for key 1 at transfer_from_main_table_to_others.pl line 59

Is my table structure causing it?

mysql Code: ....

View Replies !
Dynamically Construct And Execute SQL In StoredProcedure
I need to dynamically create an SQL statement within a MySQL 5.0.20
stored procedure.

-- PSEUDO CODE
create procedure DynSQLTest
(
in sTable varchar(45)
)
begin
declare sSQL varchar(45);

select Concat('select * from ',sTable,' where ...) into sSQL;

EXECUTESQL(sSQL);
end;

Is there a possibility to construct the SQL in a varchar and then
execute it? I spent some time googling but did not find anything.

View Replies !
LIMIT :: Longer Time To Execute
When I execute the following query without the LIMIT clause, it executes under 1 second. When I add the LIMIT clause, it takes 10 seconds to complete. The client table contains 100,000 records. What is going on?

SELECT * FROM clients
WHERE rep_id = 1
AND last_name
LIKE '%au%'
ORDER BY first_name
DESC
LIMIT 0 , 10

View Replies !
Unable To Execute Function/procedure
Its work fine for few record say 400 but when we tryed for 800 or more data .its show an error ERROR-1041 .

View Replies !
How To Execute A Batch Sql File Under Windows?
I have installed MySQL 5 in c:Program FilesMysql. I have a sql file named "books.sql" which is put in the subfolder in,it contains many statements that like "INSERT ... value ...".

my question is how to execute it? I try it, but failed.

One more question is how can I return from "->" to "sql>" promopt?

View Replies !
MySQL Execute An HTTP Request
Can the MySQL engine execute an HTTP request?

Here is he scenario. I have a table that rarely changes but when it does I need to notify a web service. Is it possible to create a trigger that will make an HTTP call when fired and pass a couple of the field values as URL parameters.

View Replies !

Copyright 2005-08 www.BigResource.com, All rights reserved