Showing entries 31 to 32
« 10 Newer Entries
Displaying posts with tag: alter table (reset)
ALTER TABLE flakiness and mysql replication

Over the past few years of dealing with mysql in larger environments, one thing I’ve always felt that ALTER TABLE statements are flaky with replication, but could never really prove it. I never had a chance to dig into some of strange things I saw, and would tend to overlook and fix them

While working for a client, I encountered an issue that I could no longer ignore. In order to reload a small table from a master database to a number of slaves, I simply piped the output of mysqldump into the master and expected everything to flow into the slaves.

The bug is very specific, and probably not very common. If you send a statement like below, as mysqldump automatically adds, to your master:

/*!40000 ALTER TABLE table_name DISABLE KEYS */;

and have configured something like

replicate-rewrite-db=mydb->mydb_slave

on …

[Read more]
MySQL Command Line Help

I tend to use MySQL from the interactive command line shell quite a bit (SSH to your db server and type the command mysql to start). I noticed today that there is a pretty extensive built in help system in this command.

You can access it by typing help COMMAND, so for instance if you type help ALTER TABLE you get a quick reference for constructing an ALTER TABLE statement.

If you can't remember what command you want to use, then typing help contents is your friend. It will output:

For more information, type 'help item', where item is
one of the following categories:
Administration
Column Types
Data Definition
Data Manipulation
Functions
Geographic features
Transactions

So if your looking for that command that outputs all the columns in a table, but don't know what it's called, you might now try help administration

[Read more]
Showing entries 31 to 32
« 10 Newer Entries