MySQL Workbench Rocks
In April MySQL Workbench 5.0.x reached GA status. I had a chance to try it and wow -- it rocks.
It's super-easy to use and I'll just copy its feature list:
- Cairo based diagramming canvas which allows output to different targets such as OpenGL, Win32, X11, Quartz, PostScript, PDF etc
- visual representation of tables, views, stored procedure/functions and foreign keys
- live database and SQL script file reverse-engineering
- database/model synchronization
- SQL script generation
- extensible architecture
- export as SQL CREATE script
- import DBDesigner4 models
- support for MySQL 5 features
- selectable notations for diagram
For me, it's a very useful tool for importing an SQL script, visually modifying it, and exporting a working SQL script. It's also a cinch to just create ER diagrams in 5 damn minutes that look decent and map out foreign key relationships.
I've used DBD4 in the past as well as Aqua Data Studio and this tool gets me more excited. If you design or work with MySQL databases, you should check it out (see screenshots). Right now it's Windows-only but they plan on releasing Linux and OSX in June, 2008.
Overall, very nice work MySQL -- this tool is light years ahead of its predecessors.
Mac OSX Leopard syslogd
If you're having issues with syslogd thrashing your computer, see this blog for more info. This worked for me and it'll do until Apple figures out and patches whatever causes Time Machine to rape syslogd.
Selecting into a CSV file in MySQL
Often times you'll get requests for a CSV dump of something in your database. From the CLI, I often just run a SELECT statement by hand to see what it is that I want then I get stuck thinking, "now how do I get this to CSV again?".
Selecting into a CSV outfile isn't hard, and I've done it many times, but everytime I do it I have to look it up so I'll just blog it here for next time.
SELECT a,b,a+b INTO OUTFILE '/tmp/result.txt' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\\n' FROM test_table;
When in doubt, blog it out.
