Tag Archives: mysql

Basic Introduction to Mysql InnoDB Performance Tuning – What are the best resources?

I used to manage a couple very large MySQL Databases (like, 1TB+). They were huge, unforgiving beasts with an endless appetite to cause me stomach problems. I read everything I could find on MySQL Performance Tuning and innodb. Here’s a … Continue reading

Posted in mysql, open source, programming | Tagged , , | 1 Comment

MySQL Integer sizes and ranges of values – How-To Create Table example

There are 5 different integer columns, each hold integer values of different sizes. Moreover, each can be signed or unsigned. If your value can’t ever be negative (for example, for an index), then you should probably make your values unsigned. … Continue reading

Posted in mysql | Tagged , , | Leave a comment

How-To MySQL CREATE TABLE Example showing default values, NULL values and comments

This example shows how to set default values for each column — as well as how to allow (or not allow) NULL values in the column. By default, any column can contain NULL values. (Note that we’re also using “CREATE … Continue reading

Posted in mysql | Tagged , , | 8 Comments

Basic How-To Example of a MySQL CREATE TABLE command

Here’s a basic example of a MySQL CREATE TABLE command. CREATE TABLE `foo`.`example_01` ( `field_1` VARCHAR(255), `field_2` CHAR(10), `field_3` INT(10), `field_4` BIGINT(20), `field_5` DATETIME ); Notice that the ‘back tic’s on each column definition (the little ` characters) are optional … Continue reading

Posted in mysql | Tagged , , | 1 Comment

How to get the contents of the database.yml file from ActiveRecord

Save to delicious. Sometimes when using Active Record you may want to create a database connection to a database other than the default database specified in your database.yml file. When this happens, the easiest way to do it is to … Continue reading

Posted in ruby on rails | Tagged , , , , | 1 Comment

A Simple Example of a MySQL Stored Procedure that uses a cursor

(Save this to Del.icio.us!) What is a cursor and when should you use one? A ‘cursor’ in MySQL is essentially just the result set that’s returned from a query. Using a cursor allows you to iterate, or step through, the … Continue reading

Posted in mysql | Tagged , | 38 Comments