Re: Disaster with dash on mysql cli interface
On Wed, 21 Jun 2006 11:12:40 -0400, Kevin Old wrote: Hello everyone, I had a horrible thing happen to me this morning and wanted to make it known to the community. I needed to delete a record from a very large table (yes, it was backed up) and like the cli interface of mysql. I ran this query: delete from tablename where id - 12345; Notice that I accidentally hit the dash (-) instead of the equal (=). It proved to be disasterous as it deleted all the records from that table. Lucky for me I had a backup from last night and not too many records were added since then and I was able to restore. For the record, I am aware of the select before delete method, but didn't use it in this one instance and it meant a few hours restoring data. Just wanted to throw this out and see if others had possible solutions for working with the mysql cli interface for maybe setting up rules for it to cancel a query if it contains a certain character (like the dash). Fat chance there is, but I thought I'd ask. Hope this helps someone, Kevin -- Kevin Old [EMAIL PROTECTED] Doesn't mysql have transactions? If it does you could just start a transaction before you do anything. This is what I do with PostgreSQL. As I recal oracle's sqlplus does this by default. begin; -- or something -- do some stuff -- if you did something dumb rollback; -- or something -- otherwise commit; -- or something -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Compile Problems -- Solaris 10 -- mysql-5.0.22
Hello, I'm trying to compile mysql-5.0.22 on Solaris 10 using the Forte Compiler (cc: Sun C 5.8 2005/10/13). I'm doing this so I can build the DBI driver for mysql (DBD::mysql). The .pkg versions are missing libmysqlclient.so required to build DBD::mysql (http://bugs.mysql.com/bug.php?id=17205). PATH: /usr/bin:/opt/SUNWspro/bin:/opt/SUNWspro/prod/bin:/usr/ucb:/etc:/usr/ccs/bin Configure: CC=cc CFLAGS=-Xa -fast -native -xstrconst -mt \ CXX=CC CXXFLAGS=-noex -mt \ ./configure --prefix=/usr/local/mysql-5.0.22 --enable-assembler make (yields error): Making all in strings /opt/SUNWspro/prod/bin/as -o strings-x86.o strings-x86.s Assembler: strings-x86.s, line 1 : Warning: Error in the # lineno from preprocessor strings-x86.s, line 2 : Warning: Error in the # lineno from preprocessor strings-x86.s, line 3 : Warning: Error in the # lineno from preprocessor strings-x86.s, line 4 : Warning: Error in the # lineno from preprocessor strings-x86.s, line 5 : Warning: Error in the # lineno from preprocessor strings-x86.s, line 6 : Syntax error strings-x86.s, line 7 : Warning: Error in the # lineno from preprocessor strings-x86.s, line 8 : Warning: Error in the # lineno from preprocessor strings-x86.s, line 9 : Warning: Error in the # lineno from preprocessor strings-x86.s, line 10 : Warning: Error in the # lineno from preprocessor strings-x86.s, line 11 : Syntax error strings-x86.s, line 12 : Warning: Error in the # lineno from preprocessor strings-x86.s, line 13 : Warning: Error in the # lineno from preprocessor strings-x86.s, line 14 : Warning: Error in the # lineno from preprocessor strings-x86.s, line 16 : Warning: Error in the # lineno from preprocessor strings-x86.s, line 19 : Inappropriate assembler version: have 02.01 expect 1.00 or greater strings-x86.s, line 23 : Syntax error strings-x86.s, line 24 : Syntax error strings-x86.s, line 31 : Syntax error strings-x86.s, line 32 : Syntax error strings-x86.s, line 33 : Syntax error strings-x86.s, line 34 : Syntax error strings-x86.s, line 37 : Illegal mnemonic strings-x86.s, line 37 : Syntax error strings-x86.s, line 50 : Warning: Error in the # lineno from preprocessor strings-x86.s, line 51 : Warning: Error in the # lineno from preprocessor strings-x86.s, line 56 : Syntax error strings-x86.s, line 58 : Syntax error strings-x86.s, line 59 : Syntax error strings-x86.s, line 60 : Syntax error strings-x86.s, line 63 : Syntax error strings-x86.s, line 66 : Illegal mnemonic strings-x86.s, line 66 : Syntax error strings-x86.s, line 78 : Warning: Error in the # lineno from preprocessor strings-x86.s, line 79 : Warning: Error in the # lineno from preprocessor strings-x86.s, line 85 : Syntax error strings-x86.s, line 86 : Syntax error strings-x86.s, line 87 : Syntax error strings-x86.s, line 88 : Illegal mnemonic strings-x86.s, line 88 : Syntax error strings-x86.s, line 88 : Illegal mnemonic strings-x86.s, line 88 : Syntax error strings-x86.s, line 90 : Syntax error strings-x86.s, line 91 : Illegal mnemonic strings-x86.s, line 91 : Syntax error strings-x86.s, line 92 : Syntax error strings-x86.s, line 93 : Syntax error strings-x86.s, line 95 : Syntax error strings-x86.s, line 96 : Syntax error strings-x86.s, line 97 : Syntax error Too many errors - Goodbye *** Error code 127 make: Fatal error: Command failed for target `strings-x86.o' Current working directory /home/andy/mysql-4.1.20/strings *** Error code 1 Does anyone have any idea how this error can be fixed? //andy -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Table Locking Problem? Very Slow MyISAM DB - PLS HELP!
Hi, I have a MySQL 3.23.55 server managing accounts on my exim mail server.. The table type on all tables MyISAM.. I have the MTA performing various queries for each incoming email - determining mail aliases, vacation messages and filtering rules etc but they're all pretty much SELECT statements.. I know this isn't ideal and i've started replacing runtime queries with processes that search text files instead (generated every few minutes etc) but it should still be able to cope I would have thought? At it's busiest, it's performing about 8 trivial queries per second. It's a Xeon 2.6Ghz machine with 1Gb of RAM (running on FreeBSD) but it's grinding to a halt. I have to keep stopping and restarting the MySQL server to regain speed. As there's many processes trying to access the same tables to do SELECTs I thought it might be a locking issue.. BDB didn't seem to help - can anyone suggest something that might help? Thanks, Andrew. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Table Locking Problem? Very Slow MyISAM DB - PLS HELP!
Hi Victor, How did you deduce that the database server is the bottleneck? Are all your processes running on the same machine? Because 'ps -aux' shows it running at 94% of the CPU and when I stop/start the mysql server, it seems to be ok again for another hour. Any ideas? Andrew Nelson wrote: Hi, I have a MySQL 3.23.55 server managing accounts on my exim mail server.. The table type on all tables MyISAM.. I have the MTA performing various queries for each incoming email - determining mail aliases, vacation messages and filtering rules etc but they're all pretty much SELECT statements.. I know this isn't ideal and i've started replacing runtime queries with processes that search text files instead (generated every few minutes etc) but it should still be able to cope I would have thought? At it's busiest, it's performing about 8 trivial queries per second. It's a Xeon 2.6Ghz machine with 1Gb of RAM (running on FreeBSD) but it's grinding to a halt. I have to keep stopping and restarting the MySQL server to regain speed. As there's many processes trying to access the same tables to do SELECTs I thought it might be a locking issue.. BDB didn't seem to help - can anyone suggest something that might help? Thanks, Andrew. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Table Locking Problem? Very Slow MyISAM DB - PLS HELP!
The reason I ask is because eight select statements should not bog down a production server. On the MySQL side, is anything being written to the slow query log? On the application side is there any virus scanning or similar activity being performed? Does iostat show any heavy reading or writing activity? Is memory being swapped? What is the server load? Do you have a high wait time or is CPU usage the only symptom? Nothing is being written very often.. Maybe a few email accounts added/modified each day. iostat shows very small disk activity (around 0.4Mb/s average). No memory is being swapped.. We do have a high wait time - the email is queueing up and the website interface to update the database (in PHP) times out when it's busy and I figured it's the CPU - I don't get what is so computational, the Databases are quite small (it's just a userbase - about 200Kb). I appreciate your help, Thanks, Andrew. Andrew Nelson wrote: Hi Victor, How did you deduce that the database server is the bottleneck? Are all your processes running on the same machine? Because 'ps -aux' shows it running at 94% of the CPU and when I stop/start the mysql server, it seems to be ok again for another hour. Any ideas? Andrew Nelson wrote: Hi, I have a MySQL 3.23.55 server managing accounts on my exim mail server.. The table type on all tables MyISAM.. I have the MTA performing various queries for each incoming email - determining mail aliases, vacation messages and filtering rules etc but they're all pretty much SELECT statements.. I know this isn't ideal and i've started replacing runtime queries with processes that search text files instead (generated every few minutes etc) but it should still be able to cope I would have thought? At it's busiest, it's performing about 8 trivial queries per second. It's a Xeon 2.6Ghz machine with 1Gb of RAM (running on FreeBSD) but it's grinding to a halt. I have to keep stopping and restarting the MySQL server to regain speed. As there's many processes trying to access the same tables to do SELECTs I thought it might be a locking issue.. BDB didn't seem to help - can anyone suggest something that might help? Thanks, Andrew. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]