Wednesday, October 5, 2011

The new MySQL Enterprise Backup 3.6.1 release

This maintenance release allow MySQL Enterprise Backup to leverage the new authentication feature of the commercial MySQL 5.5.16 server release. MySQL Enterprise Backup 3.6.1 allows the backup user to be authenticated by an external authentication method supported by the MySQL Server.

We have also fixed the following issues:
  • If the user has given a wrong combination of options or misspelled an option, MySQL Enterprise Backup now prints a message to allow the users to diagnose the issue.
  • Behavior of the incremental backup feature when used with the --only-innodb option has been corrected. If there are DDL changes between the previous backup and a new incremental backup, it is now ensured that all such DDL changes are correctly reflected when the incremental backup is restored.
  • This release also addresses the cleanup of empty temporary files that were left behind after backup.
  • The message “mysqlbackup completed OK!” is printed for each successful “copy-back” and “apply-log” operation.
For further details, please refer the the change log in the MySQL Enterprise Backup documentation.

MySQL Enterprise Backup 3.6.1 is now available for download on the My Oracle Support (MOS) website.

This text was written by Sanjay Manwani, MySQL Enterprise Backup Team.

If you are at Oracle Open World, we give two talks about backup for MySQL today: Data Protection and Recovery for MySQL and MySQL Enterprise Backup. You are very welcome to attend!

Monday, October 3, 2011

MySQL Oracle Open World talks

Some suggestions for MySQL sessions at Oracle Open World 2011.

Tomas Ulin will give the MySQL keynote today:
  • MySQL Executive Keynote: The state of the dolphin, Monday 12:30pm
Luis Soares, Sanjay Manwani, Chuck Bell and myself will give the following talks:
  • Introduction to MySQL Replication, Monday 2:00pm
    A walk-through of how MySQL Replication works and what you can do with it.  An introduction if you don't know it, and a summary of possible use cases for those of you that are already familiar with the technology.
  • Advanced MySQL Replication Architectures, Tuesday 10:15am
    Directed for the more advanced users, in this talk we go through not only the traditional but also more complex scenarious, e.g. hierarchical replication and replicating from multiple master servers into a slave server.
  • Data Protection and Recovery for MySQL, Wednesday 1:00pm
    Describes different ways to do protect your data, logical backups using mysqldump, snapshot backups, and MySQL Enterprise Backup to do backup and restore. Benefits of the different technologies and when to use what.
  • MySQL Enterprise Backup, Wednesday 5:00pm
    An introduction to the MySQL Enterprise backup tool, what you can do with it and its integration with media managers, such as Oracle Secure Backup. How to create full, incremental, and partial backups.
  • Cloud Computing Solutions for MySQL, Thursday 1:30pm
    How to use MySQL in the cloud with use cases. Describes benefits and risks. Improvements in MySQL 5.6 for InnoDB and MySQL Replication to improve the use of MySQL in the cloud.
(Please double check the time of the talks, since schedule may change.)

Windows Native Authentication for MySQL

Starting with MySQL 5.5.16 it is possible to setup password-less connections from clients into the MySQL server using the Windows SSPI authentication framework.

This functionality is provided by the Windows Native Authentication (WNA) plugin distributed with the commercial version of 5.5.16 server. The client-side support for WNA authentication is built into the client library (libmysql) distributed with the community version of 5.5.16 server and requires no additional configuration. Clients which link to 5.5.16 or higher version of libmysql will be able to connect to MySQL accounts using WNA authentication out-of-the-box.

For password-less connections to work, the server's administrator must install the WNA plugin in the server and create user accounts which use this plugin for authentication. It is also possible to allow connections to existing MySQL accounts via a proxy WNA account. With this setup Windows clients can password-less connect to the proxy account, and then proxy configuration selects the final MySQL account based on client's Windows credentials (user name or group membership). Detailed instructions on how to install the WNA plugin and setup and configure WNA accounts are given in the documentation.

Internally, the WNA plugin uses Windows SSPI API to create a shared security context between client and server, which allows server to read client's credentials. For this to work, obviously both client and server must run on a Windows machine. Additionally, both computers must be registered inside a Windows domain (in which case Windows internally uses Kerberos authentication). If this is not the case then password-less connections are still possible but only from the same computer on which server is running (in which case NTLM authentication is used).

Note that whether native Windows authentication is used or not entirely depends on the MySQL account to which a client tries to connect. If that account is configured by DBA to authenticate using WNA plugin, then this is the only option for that account - a client can connect to it only if the client supports WNA and is run by an authorized Windows user. It can not fall-back to the standard MySQL password authentication, as well as it can not request native Windows authentication when connecting to a non-WNA account.

At the moment, client support for WNA plugin is implemented mainly in the libmysql client library which is shipped with MySQL 5.5.16 (the community version). This support is built into the library and does not require any additional configuration. If your client uses this version of libmysql for connecting to the server it should be able to connect to WNA accounts.

Note that if the client is using a connector library like Connector/C++ and that library links to libmysql dynamically, then configuring the dynamic linker to use version 5.5.16 or later of libmysql will enable WNA support in your client application. If, however, the client uses libmysql based connector which is statically linked to an older version of the library (as is the case with Connector/ODBC), then it will not work with WNA plugin.

Some connectors do not use libmysql but have their own implementation of the MySQL client-server protocol (for example Connector/Java). These connectors will require changes in their implementation of the protocol to support WNA plugin.

Here is a summary of which MySQL connector products support WNA plugin at the moment:
  • Libmysql 5.5.16: Yes
  • Connector/NET 6.4.4: Yes
  • Connector/C++ 1.1.0: Yes, although not in statically linked version
  • Connector/ODBC 3.51.28 & 5.1.8: No, but watch for coming releases
  • Connector/Java 5.1.17: No, will not happen very soon
  • Connector/PHP 5.3: No, currently no plans to support WNA in PHP
This text was written by Rafal Somla, MySQL Connectors Team.

Monday, July 25, 2011

OSCON MySQL Replication Update


The slides for the MySQL Replication Update talk at OSCON are now available at larsthalmann.com

This is the MySQL Schedule for OSCON 2011:

  • MySQL Replication Update, Mon 10:40am
  • InnoDB: Performance & Scalability, Mon 4:20pm
  • MySQL Community BOF, Mon 9pm
  • PHP & MySQL, Wed 4:10pm
  • Python Utilities for Managing MySQL, Wed 4:10pm
  • PHP under the hood, Thu 10:40am
  • MySQL Technology Update, Thu 2:30pm
  • MySQL Binlog API, Fri 10:00am

If you are at OSCON, come and visit us at Oracle booth 701!

Wednesday, April 13, 2011

MySQL Workbench Utilities

One of the many new things that is being introduced this week are some great new external tools for managing MySQL servers. These are available in MySQL Workbench under the name MySQL Workbench Utilities.

It is a package of easy-to-use utilities for maintenance and administration of MySQL servers. These utilities encapsulate a set of primitive commands bundling them so that you can perform macro operations with a single command.

Some of the key features of MySQL Workbench Utilities are:
  • Plugin for MySQL Workbench 5.2.31
  • Available under the GPLv2 license
  • Written in Python
  • Easily to extend using the supplied library


How Does It Work?
There are two ways to access the utilities from within the MySQL Workbench.

You can click on the drop down arrow icon to the right of the MySQL Workbench main window. This will display a list of the plugins available. You can scroll through the screens and find the MySQL Utilities icon. The image below shows what the window looks like.



Once you hover on the MySQL Utilities icon, you will see an Action button appear. Click Action then Start Plugin to launch the MySQL Utilities shell in a new window. The image below shows what the window would look like.



You can launch any of the utilities listed by typing the name of the command. To find out what options are available, use the --help option.

Note: you can also add the MySQL Utilities icon to your home screen. Highlight Add to Home Screen and then choose a position from the menu.

You can also launch the MySQL Utilities command window by clicking on the Plugins menu item and selecting Start Shell for MySQL Utilities.

What Utilities are Available?
The MySQL Workbench and MySQL Workbench Utilities developers are adding new features and utilities with every release. If you don’t see a utility you want, check back with each release of Workbench or send the developers an email and let them know what you want!

You should try the --help option for each tool to see what options it supports. Some utilities have lots of options for controlling the operation (for example the mysqldbexport can produce one of several formats with object definitions, data, or both).

There are several options that are common to the utilities available (for instance --version, --help, --verbose) but the one that is most important is the server specification option used to connect to a specific server. This manifests as --server, --source, --destination, or --server1, etc. and all require the same \
format as follows:

--server=user_name:password@hostname:port_num:socket_file.

The parameter includes the user name followed by the user’s password (if available) separated by a colon (colon is omitted if no password) followed by the @ symbol and the host machine name. Optionally, you can provide the port number and the socket file each preceded by a colon. That sounds like a lot of crazy typin\
g but it is really simple. The following are some examples using this format.

--server=root@localhost:3306
--server=joe:pass@192.168.1.101
--server=dolly:sassyshoes@localhost:3310:/tmp/mysql.sock

The following list describes the utilities available as well as some examples of use. For more details, please see the manuals for each utility.

mysqldbcopy - Permits a database administrator to copy a database from one server either to another server as the same name or a different name or to the same server as the same or as a different name.

Example 1: Copy  a database  named  ‘util_test’ to a new name ‘util_test_copy’ on the same server.

mysqldbcopy util_test:util_test_copy
  --source=root:pass@host1:3306
  --destination=root:pass@host1:3306

Example 2: Copy  a database  named  ‘util_test’ to another server.

mysqldbcopy util_test:util_test
  --source=root:pass@host1:3306
  --destination=root:pwd@host2:33010

mysqldbexport - Permits a database administrator to export the metadata (object definitions, hence definitions) or data or both from one or more databases. By default, the utility will export only definitions.

Example 1: Export the definitions of the database ‘dev’ from a MySQL server  on  localhost via port 3306 producing CREATE statements.

mysqldbexport --skip=GRANTS
  --server=root:pass@localhost
  --export=DEFINITIONS util_test

Example 2: Export  the  data of the database ‘util_test’ producing bulk insert statements.

mysqldbexport --export=DATA
  --bulk-insert util_test
  --server=root:pass@localhost

mysqldbimport - Permits a database administrator to import the metadata (objects) or data for one or more databases from one or more files in either SQL or a text format such as CSV, TAB, GRID, or VERTICAL.

Example 1: Import the metadata of the database ‘util_test’ to server1  on  port 3306 using a file in CSV format.

mysqldbimport --import=definitions
  --server=root@localhost --format=csv
  data.csv

Example 2: Import  both  the  data  and  definitions  of  the  database ‘util_test’  to  server1  on port 3306 producing bulk insert statements from a file that contains SQL statements.

mysqldbimport data.sql --import=both
  --bulk-insert --format=sql
  --server=root@localhost

mysqldiff -  Reads the definitions of objects and compares them using a diff-like method to determine if two objects are the same based on the definition of the object.

Example 1: Find the differences among objects in database employees on one server and emp1 on the same server.

mysqldiff --server1=root@localhost
  employees:emp1

Example 2: Find differences between the salaries table on one server and the same table on another server.

mysqldiff --server1=root@localhost
  --server2=root@host2:3306
  employees.salaries:emp1.salaries
  --differ

mysqldiskusage - Permits a database administrator to see the disk space usage for one or more databases in either CSV, TAB, GRID, or VERTICAL text formats. The utility will also allow the user to examine the disk usage for the binary logs, slow, error, and general log; and InnoDB tablespace usage.

mysqldiskusage - Permits a database administrator to see the disk space usage for one or more databases in either CSV, TAB, GRID, or VERTICAL text formats. The utility will also allow the user to examine the disk usage for the binary logs, slow, error, and general log; and InnoDB tablespace usage.

Example 1: Show only the disk space usage for the employees and test databases in grid format.

mysqldiskusage --server=root@localhost
  employees test

Example 2: Show all disk usage for the server in CSV format.

mysqldiskusage --server=root@localhost
  --format=csv -a

mysqlindexcheck - Eeads the indexes for one or more tables and identifies duplicate and potentially redundant indexes.

Example 1: Scan all of the tables in the employees database to see the possible redundant and duplicate indexes as well as the DROP statements for the indexes.

mysqlindexcheck --server=root@localhost
  --show-drops employees

Example 2: Scan all of the tables in the employees database and display the indexes. Display the output in a tabular format.

mysqlindexcheck --server=root@localhost
  --show-indexes --format=TAB employees

mysqlmetagrep - Searches for objects matching a given pattern and shows a table of the objects that match the pattern `’t\_’.

mysqlmetagrep --pattern=“t_”
  --server=mats@localhost

Example 2: Find all objects that contain ‘t2’ in the name or the body (for routines, triggers, and events).

mysqlmetagrep -b --pattern=“%t2%”
  --server=mats@localhost:3306

mysqlprocgrep - Scans the process lists for processes that match the search criteria specified and will either print the result (the default) or execute certain actions on it.

Example 1: Kill all connections created by user “mats” that are younger than 1 minute.

mysqlprocgrep --server=root@localhost
  --match-user=mats --age=1m
  --kill-query

Example 2: Kill all connections with queries that have been idle for more than 1 hour.

mysqlprocgrep --server=root@localhost
  --match-command=sleep --age=1h
  --kill

mysqlreplicate - Permits an administrator to start replication among two servers. The user provides login information to the slave and provides connection information for connecting to the master.

Example 1: Setup replication between a MySQL instance on two different hosts using the default settings.

mysqlreplicate --rpl-user=rpl:rpl
  --master=root@localhost:3306
  --slave=root@localhost:3307

Example 2: Ensure the replication between the master and slave is successful if and only if the InnoDB storage engines are the same and both servers have the same storage engines with the same default specified.

mysqlreplicate --pedantic
  --master=root@localhost:3306
  --slave=root@localhost:3307
  --rpl-user=rpl:rpl -vv

mysqlserverclone - Permits an administrator to start a new instance of a running server.

Example 1: Create a new instance of a running server.

mysqlserverclone --new-port=3310
  --server=root:pass@localhost
  --new-data=/source/test123

Example 2: Create a new instance of a running server set the root password and turn binary logging on.

mysqlserverclone --new-port=3310
  --server=root:pass@localhost
  --new-data=/source/test123
  --root-password=pass
  --mysqld=--log-bin=mysql-bin

mysqluserclone - Permits a database administrator to use an existing user account on one server as a template and clone a MySQL user such that one or more new user accounts are created on another (or the same) server with the same privileges as the original user.

Example 1: Clone ‘joe’ as ‘sam’ and ‘sally’ with passwords and logging in as root on the local machine.

mysqluserclone --source=root@localhost
  --destination=root@localhost
  joe@localhost sam:secret1@localhost
  sally:secret2@localhost

Example 2: Show all of the users on the localhost server in the most verbose output in CSV format.

mysqluserclone --source=root@localhost
  --list --format=CSV -vvv

mut - Designed to execute predefined tests to test the MySQL Utilities.

Example 1: Run all tests.

mut --server=root@localhost

Example 2: Run all tests that start with ‘clone_user’ and set the width of the display to 70 characters.

mut --server=root@localhost
  --do-tests=clone_user –width=70

How Can I Get It?
You can download MySQL Workbench from:


You can also download the latest development source code tree for the MySQL Workbench Utilities from:

https://launchpad.net/mysql-utilities

Monday, April 11, 2011

MySQL Replication & Backup at Collaborate 11

The MySQL talks at Collaborate 11 start in just a few hours. The MySQL Replication and Backup team will make the following presentations:
  • At 11 April 11:45am, Andrei will present "Boosting MySQL Replication Performance Through Multi-Threaded Slave" in which he shows the ongoing development of the multi-threaded slave and how you can try it out for yourself.
  • At 11 April 2:30pm, I will present "MySQL Replication" and go through an overview of all the new features that has been developed for MySQL Replication. It is a long list.
  • At 12 April 3:15pm, Luis do an "Introduction to MySQL Replication" for anyone new to MySQL Replication or who wants a refreshed mind on how it works.
  • At 13 April 8:00am,  Mats presents "Sharding Techniques for MySQL" to show how you can do sharding with MySQL.
  • At 13 April 10:30am, Sanjay talks about "MySQL Enterprise Backup" and the new features we have developed for doing online backups.
  • At 14 April 09:45am, Chuck gives an "Introduction to MySQL in the Cloud" that describes how easy it is to use MySQL in a cloud.
The best way I've found to find all the MySQL talks, is to surf to http://collaborate11.ioug.org/Education/ScheduleBuilder/tabid/79/Default.aspx and enter "MySQL" as a keyword.

Also, Sheeri's blog posts contains a very good description of many of the MySQL talks:
Have a great conference!