Showing entries 13873 to 13882 of 44917
« 10 Newer Entries | 10 Older Entries »
Snippet: Show column information using MySQL Connector/Python

Problem

You have a query executed by MySQL Connector/Python and would like to show column information nicely on the console.

Solution

Every cursor object has a description property. This can be used to show information about the columns in a result set.

columns = []
maxnamesize = 0
for coldesc in cur.description:
    coldesc = list(coldesc)
    coldesc[2:6] = []
    columns.append(coldesc)
    namesize = len(coldesc[0])
    if namesize > maxnamesize:
        maxnamesize = namesize

fmt = "{{nr:3}} {{name:{0}}} {{type:12}} {{null}}".format(
    maxnamesize+1)
colnr = 1
for column in columns:
    (colname, fieldtype, nullok, colflags) = column
    print(fmt.format(
        nr=colnr,
        name=colname,
        null='NOT …
[Read more]
New MySQL 5.6-Feature host_cache_size does not work

Today as i was learning for the new MySQL 5.6-certification (more about that in a later post) i stumbled again across the host_cache-Table that was added to MySQL in 5.6.5. Before that you had no chance to check which hosts are already known by the MySQL-server.

So thats a pretty good feature for us. And even better: you could resize the size of the host_cache now! Whoohoo, awesome! As we have a lot of servers that need to connect to one of our MySQL-server and we could not switch to ip-based-authentication we were really happy to tune the host_cache-size without recompiling MySQL.

Unfortunately i noticed that the performance_schema.host_cache table only holds 128 rows and that the content was changing everytime i checked. So i logged in to a server that wasn’t already in the host_cache-table, made a connection attempt to the mysql server  and checked again the host_cache-table:

The server was now in the …

[Read more]
Taking backups on Percona XtraDB Cluster (without stalls!)

I occasionally see customers who are taking backups from their PXC clusters that complain that the cluster “stalls” during the backup.  As I wrote about in a previous blog post, often these stalls are really just Flow Control.  But why would a backup cause Flow control?

Most backups I know of (even Percona XtraBackup) take a FLUSH TABLES WITH READ LOCK (FTWRL) at some point in the backup process.  This can be disabled in XtraBackup (in certain circumstances), but it is enabled by default.

If you go to your active cluster right now an execute a …

[Read more]
Ten Best MySQL Books

A bit over four years ago I collapsed just across the finish line of completing a book on MySQL. It was 700 pages and even I am not long-winded enough to write it all myself but fortunately Sheeri did a standup job for her half of the book. Writing this book was one of the most painful processes in my life. Even so, it was a good thing in some ways. Looking back, I am satisfied that others still think its a good book even in a field where literature gets out of date very rapidly. Just a few days ago I run across a link with a version of the "ten best" MySQL books. I will pass it along with one comment  -- I feel the High Performance MySQL book that Baron Schwartz, Peter Zaitsev and others wrote should be included in this list. Indeed it should be very high on the list. For those who have moved past the basics it is an invaluable resource. For SQL optimization I think the Effective MySQL Optimizing SQL Statements by Ronald Bradford …

[Read more]
MySQL Workbench: Vertical Query Output

MySQL Workbench have one nice feature which is probably a stranger for some of us. The name of this feature is vertical query output, it help in situations where the standard Workbench output will not be very useful. This functionality is very easy to use and in this post I’ll try to visualize some of it’s benefits.

First we need to know how to use it, so we’ve provided you two options to execute the query with vertical output. One of them is the menu bar where you can find item named Execute vertically, you’ll also find hint about the shortcut for that option it’s CTRL+ALT+RETURN.

After you know how to get the vertical query output, I’ll show you some screen shots to compare it with command line output.

Let’s take the command that suits best to this type of output, it’s SHOW ENGINE INNODB STATUS. Normally to understand the output, you probably copy it to some notepad app, and …

[Read more]
Triggers: Comparisons, New Features, and a Trick

I'll show a chart which indicates the level of support for trigger features in major open-source DBMSs.
I'll comment on new features in MySQL 5.7.
I'll show how triggers can be used to abort statements which are taking too long.

Trigger features in major open-source DBMSs

Feature Firebird Ingres MySQL+MariaDB PostgreSQL
Any compound statement YES - YES -
Alter YES - - -
Disable YES - - YES
[Read more]
Percona Server 5.6.13-61.0 first GA release is now available

Percona Server version 5.6.13-61.0

Percona is glad to announce the first GA (Generally Available) release of Percona Server 5.6.13-61.0 on October 7th, 2013 (Downloads are available here and from the Percona Software Repositories.

Based on MySQL 5.6.13, including all the bug fixes in it, Percona Server 5.6.13-61.0 is the first GA release in the Percona Server 5.6 series. All …

[Read more]
[MySQL][Spider][VP]Spider-3.1 VP-1.0 released

I'm pleased to announce the release of Spider storage engine version 3.1(beta) and Vertical Partitioning storage engine version 1.0(beta).
Spider is a Storage Engine for database sharding.
http://spiderformysql.com/
Vertical Partitioning is a Storage Engine for vertical partitioning for a table.
http://launchpad.net/vpformysql

Please use the following for downloading binary file.
http://spiderformysql.com/download_spider.html

The main changes in this version are following.
Spider
- Add server parameter "spider_general_log" and "spider_log_result_errors".
- Add table parameter "force_bulk_update" and "force_bulk_delete".
- Add "spider_bka_mode=2" and "bka_mode=2". …

[Read more]
Tuning MySQL 5.6 configuration – Webinar followup

We had a wonderful time during the Sept. 25 webinar, “MySQL 5.6 Configuration Optimization,” and I got a lot more questions than I could answer during the hour. So here is a followup with answers to the most interesting questions you guys asked. (You can also watch a recording of entire webinar here.)

Q: What is the impact of having innodb_stats_on_metadata=off in terms of seeing actual table size in information schema ?

A: In MySQL 5.6 this option if off by default. If you disable it in earlier version you will still see the actual table and index sizes as …

[Read more]
Get Started on the Leading Database for Web Applications and Cloud

MySQL is the leading database for web applications and the leading database for cloud. To facilitate your use of MySQL, start your learning by taking the MySQL for Beginners training course

This course covers topics permitting you to:

Describe MySQL GUI tools Describe the features and benefits of MySQL Explain the basics of relational databases Design an effective database Build a database and tables by using SQL Modify or delete database entities Query data with the SELECT command Join data from multiple tables Perform nested subqueries Use built-in MySQL functions Explain MySQL storage engines Explain database transactions Obtain database metadata Monitor database performance Perform database backup and recovery Export and import database data

You can take …

[Read more]
Showing entries 13873 to 13882 of 44917
« 10 Newer Entries | 10 Older Entries »