Showing entries 28143 to 28152 of 44919
« 10 Newer Entries | 10 Older Entries »
Monitoring Disk Space

Some time back, when a client wanted us to setup MySQL Enterprise Monitor, we were surprised to find out that disk monitoring was not available! We worked hard to come up with a solution. Eventually, we decided to setup a custom agent to monitor the disk. Below is the result of that.

While this script may not work as-is for everyone, it should at least provide a basis for such a script. This script has been modified to send an email instead of plug directly into the MySQL Enterprise Monitor. But, it hopefully will get our creative juices flowing...

#!/bin/bash
#
# This script does a very simple test for checking disk space.
# 
# Valcora: http://www.valcora.com
#

CHECKDISK=`df -h | awk '{print $5}' | grep % | grep -v Use | sort -n | tail -1 | cut -d "%" -f1 -`
ALERT_VALUE="80"
MAIL_USER="root@localhost.com"
MAIL_SUBJECT="Daily Disk Check"

if [ "$CHECKDISK" -ge "$ALERT_VALUE" ]; then
  echo "At least one of my disks is …
[Read more]
Export All To CSV

Last night I was asked by a client to export all of the tables into CSV format. I thought no problem. Then I saw the long list of table names! They wanted every one of them in CSV format! At that point, I started thinking about making a backup and then importing them all as CSV storage engine and then I realized CSV was disabled on the sandbox server! So, I thought well, I could try MySQL Query Browser, but then I figured I would still have to do it on a table-by-table basis. That is when I decided to go the Bash script route!

This lead to the formation of the brief script you see below. It simply connects to a given database, shows the list of tables, and then dumps out the contents in CSV format to individual files named tablename.csv in the current directory. After just a few minutes of scripting, it was all over and I had a handy little script for the next time they or another client ask for the same thing!

[Read more]
Converting Storage Engine

Have you ever been asked to convert all of the tables in a given database or on a server to a new storage engine? Well, we have! Sometimes, if it is only a few tables, firing off a few "ALTER TABLE ... ENGINE=InnoDB;" is fine. Other times, it is a nightmare if there are lots of tables and/or databases.

To make our life easier in such times, we created the following Bash script. Save the file as something like "convert_tables.sh" and make sure to make it executable. You can do this in Linux by executing "chmod a+x ./convert_tables.sh." Take a look at the code and we will give you an example of how to run it!

#!/bin/bash
# Crawl through all of the tables in a database or databases and convert all tables to a given storage engine.
# 
# Valcora: http://www.valcora.com
#

#### Begin Configuration ####
DBNAMES="mydb1 mydb2"           # Separate list of Databases by spaces
NEW_ENGINE_TYPE="InnoDB"        # Storage engine to …
[Read more]
Finding All MyISAM Tables

Below is a small Bash script to crawl through all the tables in a MySQL database and look for any and all MyISAM tables. We developed this script when we realized that a team of developers were ignoring our requests to create all tables as InnoDB. We set the default storage engine to be InnoDB, however, the team would declare the Storage Enginge to be MyISAM which caused MySQL to ignore our default declaration.

Yes, we could run a "SHOW TABLE STATUS," but that would require staring at a lot of table entries in some databases. Naturally, we could also query the Information Schema database as well. All of those methods are fine. For our purposes, we wanted a fairly simple script that would do the scanning for us lazy types and yet work on pretty well all versions of MySQL.

To solve the problem, we developed this simple script to find any and all tables that were MyISAM format. With that in mind, all of the values are …

[Read more]
DBA Scripts

Over the years the DBA's have created simple Bash and PHP scripts to make their life easier. We feel that sharing these with the MySQL community may help our fellow database administrators and make their life a little easier from time to time!

With that in mind, we will periodically post a new script that we hope will be of some value. Some of the scripts are meant to perform regular maintenance activity, routine tasks, and/or query the database schema for certain table types, and such.

Some of the scripts may work as-is, while others may need to be modified to suit your needs. Either way, it should provide a starting point for accomplishing your work.

Naturally, we can make no guarantees as to the effectiveness of these scripts. It should go without saying that you need to always test them on a non-critical server before you attempt to run them in a critical production environment. While, we believe our …

[Read more]
Launching of .CAT

We are launching the .CAT extension this month. This is the official extension for Catalonia. .CAT procedures and our sales contract can be seen at https://www.gandi.net/domaine/cat/info

Rates vary from 21€ to 28€ excl. VAT per year, for creations and renewals, depending on your rate scale.

To purchase a .CAT domain name, you only need to enter the name that you would like on Gandi's home page, or go to https://www.gandi.net/domain/buy/search/ where you may enter your domain name and select .CAT from the list of available extensions.

MySQL University: MySQL replication: new features in MySQL 5.1 and 6.0

This Thursday (May 7th, 14:00 UTC), Lars Thalmann will give a MySQL University session on MySQL Replication: Walk-through of the new 5.1 and 6.0 features. Lars is leading the replication and backup teams at MySQL, so this is one of the best opportunities to ask whatever questions you might have about new replication features in MySQL.

For MySQL University sessions, point your browser to this page. You need a browser with a working Flash plugin. You may register for a Dimdim account, but you don't have to. (Dimdim is the conferencing system we're using for MySQL University sessions. It provides integrated voice streaming, chat, …

[Read more]
Big Data: SSD's, R, and Linked Data Streams

The Solid State Storage Revolution: If you haven't seen it, I recommend you watch Andy Bechtolsheim's keynote at the recent Mysqlconf. We covered SSD's in our just published report on Big Data management technologies. Since then, we've gotten additional signals from our network of alpha geeks and our interest in them remains high.


R and Linked Data Streams: I had a chance to visit with Dataspora founder and blogger Mike Driscoll, an enthusiastic advocate for the use of the open source statistical computing …

[Read more]
Give and Take

Have you ever looked at the source code of MySQL Workbench? There are quite some hidden gems there, e.g. the OpenGL canvas and our latest addtion: a new UI port of the famous open source edit control Scintilla. This port allows us to use this fantastic editor control natively on Mac OS X Leopard as a Cocoa framework.

In fact, we are using Scintilla for a long time already, mainly on Windows. It allows us to give you a powerful editor interface for SQL code. This includes features like syntax highlighting, text markers (e.g. for marking syntax errors), code folding, code completion and many more. However, so far we could not use it on OS X. There is a Carbon port available, but that did not work well (particularly, if the rest of the UI is using Cocoa) so we decided to write our own …

[Read more]
Maatkit version 3519 released

Maatkit version 3519 is ready for download. There are a lot of changes in this release, many of which are incompatible with previous releases. There are also a lot of important new features. Read on for the details.

First, thanks to everyone who contributed to this month’s release. A lot of people have jumped into Maatkit and started committing code. I attribute this to deliberately forcing a more open policy with decisions being made on the mailing list, rather than the former policy of “Percona pays for development, so they have more say than you do” — a snobby and ill-advised way to treat an open-source project. If you are interested in contributing to Maatkit, please ask. Subversion commit rights are being handed out willy-nilly. It’s great!

Here’s a synopsis of this …

[Read more]
Showing entries 28143 to 28152 of 44919
« 10 Newer Entries | 10 Older Entries »