You could do SELECT SQL_NO_CACHE. This is used by mysqldump to always dump fresh data to a text file. This may also help flush the innodb buffer pool if the table being SELECTed is InnoDB.
If you cannot maniuplate the SELECT statements, then set query_cache_type to 0. That will make all SELECTs behave like SELECT SQL_NO_CACHE. You can do this without restarting mysql:
Step 1) Add this to the /etc/my.cnf
[mysqld]
query_cache_type=0
Step 2) Run this in mysql client
SET GLOBAL query_cache_type = 0;
FINAL WORD
Doing this may increase read I/O. You may also want to consider setting innodb_max_dirty_pages_pct = 0 to keey the innodb buffer pool with the freshest data that is as fully flushed to disk as possible.
Step 1) Add this to the /etc/my.cnf
[mysqld]
query_cache_type=0
innodb_max_dirty_pages_pct=0
Step 2) Run this in mysql client
SET GLOBAL query_cache_type = 0;
SET GLOBAL innodb_max_dirty_pages_pct = 0;
UPDATE 2011-05-20 11:17
It is possible all the DB Connections have timed out from PHP's vantage point.
See if restarting MySQL and apache will do it.
Also, make sure that the timeout values for MySQL, PHP, and Apache all match up
Also, do this
netstat | grep [m3][y3][s0][q6] | grep TIME_WAIT
This helps see if any dead DB Connections have not been release by the OS
What you're looking for is...
ESCAPED BY '"'
In CSV, one way of including literal quotation marks inside a single field is by doubling them up.
In the example file you posted, that's exactly what's happening at line 44.
The rest of your statement looks correct. Replace the ESCAPED BY
part with what I've shown above, and you should be good.
http://dev.mysql.com/doc/refman/5.5/en/load-data.html
Occurrences of the ENCLOSED BY character preceded by the ESCAPED BY
character are interpreted as part of the current field value.
...which is exactly what you're needing.
Best Answer
I can understand you saying "stable". There is no clean mechanism in MySQL to implicitly govern the order in which MySQL can delete rows using
LIMIT
. It is actually not transaction-safe for MySQL Replication.The only way to guarantee an orderly deletion of rows is to delete by a PRIMARY KEY or UNIQUE KEY that does not rely on an auto_increment column.
EXAMPLE OF STABLE DELETE
Suppose you want to delete the first 10 employees in a company table (layoffs do hurt, this is only an example)
You can safely delete the 10 employees as follows:
This would be great as long as you create the empid outside this table. This would not present a Replication Slave with a problem even if the auto_increment sequence on a Master is completely different from that of the Slave.