Posted by admin on November 16, 2008
Export schema/ data out from mysql To export schema and/or data, you can use mysqldump command: mysqldump -u [username] -p[password] -d [schema_name] > [filename].sql -d means no data (just gives me the schema). -B is needed for multiple schema output -h (hostname) Export data out from postgresql Export table data from postgresql to csv format Backup [...]
Posted by admin on June 26, 2008
Control Flow in SQL SELECT name AS Name, category AS Category, IF(winter>500, "Sells", "Slow") AS Trend FROM sales; http://www.roseindia.net/mysql/mysql5/flow-control-constructs.shtml Rename tables RENAME TABLE table1 TO table2; Add a user connect mysql INSERT INTO user VALUES(‘%’,’monty’,PASSWORD(‘some_pass’); FLUSH PRIVILEGES; Monitoring The number of mysql processes running at any given time should be monitored. I do this manually [...]
Posted by admin on April 5, 2008
Understand Query Processing Basic Before tuning your slow query, you better understand how your database process your query first. Here are the steps: Each client connections gets its own thread within the server process (MySQL). The connetion’s queries execute within that single thread, which in turn resides on one core or CPU. The database server [...]