Yazan: dp | 06 May 2010 | No Comments
Categories: Servers
Yesterday, I managed to delete the primary database that we use at work. I won’t go in to how this happened, other than to say: Fuck you MySQL Workbench. I was trying to get a map of the table relations within the database. Needless to say, it didn’t work. After the immediate pants-wiping, I restored [...]
Yazan: dp | 02 June 2009 | No Comments
Categories: Uncategorized
Recently, I needed to find all of the data in a table that was being used for HTML output, that had non-printable characters. The following SQL statement should do that for you: select id, name from table_name where name not regexp ‘^[a-zA-Z0-9_ ,&;\/<>(²):%*#?$|!+.\"\'-]+$; This code is MySQL specific, but should be applicable anywhere, really.