SET global general_log = 1;
SET global log_output = 'table';
Taken from here
Keeping track of interesting places I put my feet on in the software development world.
Search This Blog
Showing posts with label mySql. Show all posts
Showing posts with label mySql. Show all posts
Sunday, March 3, 2019
Enabling mysql.general_log
Wednesday, February 13, 2019
Looking for (and killing) locks in mySQL
Taken from here.
1) List all your processes with
SHOW FULL PROCESSLIST
2) Look at the "State" column, it will mention a lock if existent
3) Kill the process you want by running
KILL [process_id_taken_from_process_list]
1) List all your processes with
SHOW FULL PROCESSLIST
2) Look at the "State" column, it will mention a lock if existent
3) Kill the process you want by running
KILL [process_id_taken_from_process_list]
Thursday, May 18, 2017
mySQL Error Code: 3037 Invalid GIS data provided to function st_geometryfromtext.
If you have been trying to find what's wrong with your geometry objects and why your sql insert statement is failing, check this, which reveals the cause (congrats to all of us who went "as far as completing a BSc degree in computer science" (and how far is that?) and could yet miss this...).
I was startled because, in cloning some tables from one DB schema to another, I was facing this error. But how come values that do exist in one table cannot be inserted (are treated as invalid) in another ?
Later on I heard that this was a change made in later versions of mySQL. So I assume the records were inserted at the time this constraint was not there yet. And they must have kept existing data as valid for backward compatibility.
I was startled because, in cloning some tables from one DB schema to another, I was facing this error. But how come values that do exist in one table cannot be inserted (are treated as invalid) in another ?
Later on I heard that this was a change made in later versions of mySQL. So I assume the records were inserted at the time this constraint was not there yet. And they must have kept existing data as valid for backward compatibility.
Tuesday, January 3, 2017
Numbering the result set records in mysql (oracle like ROWNUM)
Here's a nice stackoverflow answer as to how to display row numbers in a mySql query. (I am perplexed how is this a missing feature both in mySql Workbench and in the proprietary sqlYog).
Seems you can declare variables within queries and use them, on the fly. You may need, this, someday.
Seems you can declare variables within queries and use them, on the fly. You may need, this, someday.
Thursday, October 6, 2016
Find out which mySql version you are using without using the command line
Most posts will tell you to run something in the mysql command line, but in case you do not have it installed, like me (I have only an sql editor installed), function VERSION can give you that from the Sql Editor you are using:
Simply run a SELECT VERSION()
Simply run a SELECT VERSION()
Subscribe to:
Posts (Atom)