Showing entries 31 to 40 of 63
« 10 Newer Entries | 10 Older Entries »
Displaying posts with tag: howto (reset)
How to use PERFORMANCE_SCHEMA to check InnoDB mutex waits

SummaryTo set up InnoDB mutex waits monitoring via PERFORMANCE_SCHEMA in general with MySQL 5.6.9 you should do at least the following:

  1. Start MySQL server with all mutex related instruments enabled at startup (performance_schema=ON by default on recent 5.6.x), like this:

    mysqld_safe --performance_schema_instrument='wait/synch/mutex/innodb/%=on' &
  2. Connect to server and set up proper consumers explicitly, like this:

    UPDATE performance_schema.setup_consumers SET enabled = 'YES' WHERE name like 'events_waits%';
  3. Run your problematic load.
  4. Check waits using whatever tables you need, like this:

    mysql>  select event_name, count_star, sum_timer_wait from performance_schema.events_waits_summary_global_by_event_name where event_name like 'wait/synch/mutex/innodb%' and count_star > 0 order by sum_timer_wait …
[Read more]
How To - Guide to Importing Data from a MySQL Database to Excel using MySQL for Excel

Fetching data from a database to then get it into an Excel spreadsheet to do analysis, reporting, transforming, sharing, etc. is a very common task among users. This task can be accomplished in several different ways and with different tools getting the same result; but users may find the process rather complicated, too technical and lengthy. With MySQL for Excel the task of importing data from a MySQL database to an Excel spreadsheet becomes an easy one and accessible to all types of users.  Here is a quick guide describing how to import data to Excel using MySQL for Excel.

Fetching rows as dictionaries with MySQL Connector/Python (revised)

It is possible with MySQL Connector/Python to define your own cursor classes. A very good use case is to return rows as dictionary instead of tuples. This post shows how to do this using MySQL Connector/Python v1.0 and is an update for an older blog entry.

In the example below we are subclassing the MySQLCursor class to create a new class called MySQLCursorDict. We change the _row_to_python() method to return a dictionary instead of a tuple. The keys of the dictionary will be (unicode) column names.

from pprint import pprint
import mysql.connector

class MySQLCursorDict(mysql.connector.cursor.MySQLCursor):
    def _row_to_python(self, rowdata, desc=None):
        row = super(MySQLCursorDict, self)._row_to_python(rowdata, desc)
        if …
[Read more]
How to create a MySQL bug report that someone would like to read and comment on

It happens to me almost every day. I note some "bug report" at that makes me think that my job is miserable... Like this, Bug #66580. What readers of such a bug report are supposed to do with it? Other than ignore?

Today I want to stay positive, so instead of cursing in public let me give some advices inspired by this great HOWTO and detailed instructions from MySQL site.

Before you send a problem report to MySQL public bugs database, please:

  • Try to find similar bugs by searching MySQL bugs database. Google search for <something specific, like stack trace or message from …
[Read more]
Consulting essentials: Building your business

Read the original article at Consulting essentials: Building your business

In the last two posts on how to build a successful consulting business I shared advice and tips on closing deals and managing and completing your engagements.

This post will look at where to focus your efforts in order to sustain your consulting business, and build skills.

Focus on your subject matter expertise

Being a subject matter expert takes years of education, and professional experience to build. It’s your most valuable asset. Build it, and use it. This is not to say there isn’t great value in …

[Read more]
How To – Resolve MySQL Error Incorrect Key File for Table

Background Knowledge

I using PHP v5.3.3-7 PDO running a MySQL v14.14 Distrib 5.1.49 on Debian v6.0.4 64-bit and executing a SQL load data infile statement.

I received “PHP Warning: PDOStatement::execute(): SQLSTATE[HY000]: General error: 126 Incorrect key file for table ‘/tmp/#sql_66f_0.MYI’; try to repair it”. My database table in this instance is using the storage engine of InnoDB and therefore one can not use the “repair table”.

From my experience I’ve found that this error can mean one of two issues however I have not found information from MySQL confirming this.

Solution – Repair Table

The error message may mean the database table is corrupted and requires a repair.

  1. Run repair table on the …
[Read more]
TaskFreak! v0.6.2 – Customizing Status

Background Knowledge

The progress of a task in TaskFreak! is shown as a percentage value and is not exactly visually appealing to quickly spot the progress. With a few minor alterations we can show the percentage completed bar that fills as the task progresses and a gradient bar indicating the progress along with the percentage value.

This solution was posted by Searcher at Re: Taskfreak Customizing Status.


  1. Edit at line #268 as shown below.
    Cod Before

    <th width="<?php echo FRK_STATUS_LEVELS * 2; ?>%" onclick="freak_sort('statusKey')" colspan="< ?php echo FRK_STATUS_LEVELS ?>" class="sortable">< ?php echo (FRK_STATUS_LEVELS == 1)?'X':$langForm['status']; …
[Read more]
MySQL Cluster Manager hands on

MySQL Cluster is, without doubt, the most interesting MySQL product Oracle offers to the people out there. It’s the flagship, the holy grail, based on the knowledge and technology developed doing our well known MySQL Server. I’m not going to go through why MySQL Cluster is so great, that you can find anywhere. I’m going [...]

Debugging MySQL Cluster installed using RPMs using gdb

This post explains how to debug MySQL Cluster 7.1, installed using the RPM packages, using gdb on a Linux box (Red Hat, Oracle Enterprise Linux, CentOS, ..).

When a data node crashes lots of information goes into the error log, trace files and out log. However, it makes sometimes sense when you can repeat the crash, to run the data node in debug mode, or using gdb.

First, using RPMs and a Linux distribution, make sure you have the ‘debuginfo’ package installed. For example, for Red Hat or Oracle Enterprise Linux on a 64-bit machine, this package would be called: MySQL-Cluster-gpl-debuginfo-7.1.15-1.rhel5.x86_64.rpm .

Create a file with the following commands, we will name it ‘ndbd.gdb’:

set pagination off
set logging overwrite on
set logging file …
[Read more]
MySQL Cluster: Rotating the log file of the Data Nodes

There is a log file called ndb_<NodeID>_out.log created by the MySQL Cluster data nodes which can become quite big overtime. There is, unlike the cluster logs created by the management nodes, no rotation build in. So you have to revert to the basics and copy the file away, truncating the old one.

For example, if you want to ‘rotate’ the log file of data node with NodeID 3:

shell> mv ndb_3_out.log.1.gz ndb_3_out.log.2.gz
shell> cp ndb_3_out.log ndb_3_out.log.1
shell> cat /dev/null > ndb_3_out.log
shell> gzip ndb_3_out.log.1

It’s not elegant, and you might lose some entries, but it will help you keeping disk usage minimal. If you don’t need the log at all, just line 3 would do the trick.

You can use logrotate‘s copytruncate to …

[Read more]
Showing entries 31 to 40 of 63
« 10 Newer Entries | 10 Older Entries »