A few years ago, I used MySQL Sandbox to filter binary logs. While that one was a
theoretical case, recently I came across a very practical case
where we needed to provision an Oracle database, which is the
designated slave of a MySQL master.

In this particular case, we needed to provision the Oracle slave
with some auditing features in place. Therefore, mass load
functions were not considered. What we needed was the contents of
the MySQL database as binary rows i.e. the same format used …

Last month, Ronald Bradford, Giuseppe Maxia and Mark Leith spoke about how to simulate
a mysqldump –ignore-database.
This mysqldump option doesn’t exist and
these three guys have given
us various helpful solutions.

As a continuation to a previous blog post last week and inspired by
Kedar I have created a small script to export
tables, stored procedures, functions and views into their
respective file. It works for multiple databases where you can
specify a list of databases too and although things like events,
triggers and such are still missing they are easily added.

If you like to keep your ddl backed up in some source management
tool like svn or cvs and want to do it individually for stored
procedures, events, triggers, tables and such rather than having
a single file you can easily do so using the below. You could
even include the –skip-dump-date or –skip-comments and use the
below to compare ddl daily checking for alterations thus making
sure you are aware of any ddl changes done on the database.

Several people have suggested a more flexible approach at
mysqldump output in matter of user privileges.
When you dump the data structure for views, triggers, and
stored routines, you also dump the permissions related to
such objects, with the DEFINER clause.
It would be nice to have such DEFINER clauses removed, or
even replaced with the appropriate users in the new
database.

I ran into a very interesting issue with a customer recently. The
customer was storing JPEGs in MySQL (as BLOBs obviously) and was
wanting to setup some additional MySQL slaves. Nothing crazy
there. So I did the normal steps of scheduling a mysqldump with
the --all-databases and --master-data options. Trouble is, the
next day when I start importing the dump, 'mysql' bombed up with
"ERROR at line X: Unknown command '\0'". I used 'sed' to pull out
the lines around the error and didn't really notice anything out
of the ordinary. After a bit of Googling, one suggestion was to
do a simultaneous backup and restore (basically a "mysqldump .. |
mysql -h ..."). In this case, …

Keith Murphy asks if you have ever edited your dump files before feeding them to
the database. And he recommends using sed. This reminds me
of a war story, when I was consulting in Milan. The customer
needed, among other things, to import a huge text file (created
by a third party application) into a MySQL database. I did
everything, including a cron job to load the data every day. By
the time I left for the airport, the third party application
hadn't yet provided its first sample, but since we knew the
fields list, it was a simple case of …

Today I was asked a question about defining custom extensions for
vim syntax highlighting such that, for example, vim would know
that example.lmx is actually of type xml and apply xml syntax
highlighting to it. I know vim already automatically does it not
just based on extension but by looking for certain strings inside
the text, like <?xml but what if my file doesn't have such
strings?

After digging around I found the solution. Add the following to
~/.vimrc (the vim configuration file):

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.