MySQL

How to: Convert MySQL Hierarchical Data Flat List Result to Multi-Dimensional PHP Array

Recently, for a fun stuff, I came across a need of an infinite level of categories.

Move rows between tables, avoid duplicate and update auto increment value.

Table "books" and "books_tmp" is identical.

"books" table is production state.
"books_tmp" is sandbox/testing/pre-production state.

Data comes in csv files >> dumped to "books_tmp" >> checked,

Best field type for storing various of data to MySQL table.

IP address:

Use: INT 4 Unsigned

Convert the IP address to 32-bit unsigned integer before storing it to table.
You can use built in MySQL INET_ATON() and INET_NTOA() function to convert this.

How to backup and restore your MySQL database using command line mysqldump?

MySQL is a powerful database engine (from my side of view ;-)) But it also might have several problem. Ie: a corrupted table after database crash.

Here the simple way to backup your MySQL database or table from command line.

How to move MySQL datadir to another drive

Your MySQL database takes a huge space and your current drive is almost full?
One of the available options is to move MySQL database to another drive with minimal downtime, here is how...

If you enjoyed this post, make sure you subscribe to our RSS Feed! Or if you prefer, you can Follow us on Twitter instead.