mysql database

Is your backup complete? – backup MySQL users privileges / grants – pt-show-grants

Everybody knows the criticality of backup. You might have had your database dumped, data directory copied, flat files exported and even config and binary log files backed-up. But did you backup your MySQL user privileges? One can easily forget to backup the user privileges but it is much easier to do and you should backup your MySQL server user privileges / grants regularly. 1. Backup MySQL user privileges using mysqldump: $] mysqldump -uUSER -pPASS –databases mysql > mysql.sql

Load columnar text file into MySQL table

Ever come accoss a situation where you have to load a flat text file into MySQL with data provided in single column! Say, your data to be loaded in table looks something like this: Company1 Street Name City, MyState 8582 (999)999-999 another_Company Another Street 2 New City, NWSTATE 8582 (111)111-1111 So how’d you go about loading a text file into MySQL where field values are given in a single column!! In the above sample, data has fields like company-name, address-1, address-2 and phone given in a text file line by line. Ofcourse you can write a piece of code in...