Nov 15

MMM (Multi-Master Replication Manager for MySQL) is a set of flexible scripts to perform monitoring/failover and management of MySQL master-master replication configurations (with only one node writable at any time).

The toolset also has the ability to read balance standard master/slave configurations with any number of slaves, so you can use it to move virtual IP addresses around a group of servers depending on whether they are behind in replication.

The current version of this software is stable, but the authors would appreciate any comments, suggestions, bug reports about this version to make it even better. Current version 2.0 development is led by Pascal Hofmann. If you require support, advice or assistance with deployment, please contact Percona or Open Query.

Tagged with:
Jun 28

Description: myisamchk presents the below error when trying to fix a table with blob columns: miguel@hegel:~/test> myisamchk -r home/miguel/test/*.MYI – recovering (with sort) MyISAM-table ‘/home/miguel/test/table.MYI’ Data records: 43968 – Fixing index 1 Wrong block with wrong total length starting at 76758748 myisamchk: error: Not enough memory for blob at 76758800 MyISAM-table ‘/home/miguel/test/table.MYI’ is not fixed because of errors .

Error Code:

myisamchk: error: myisam_sort_buffer_size is too small
MyISAM-table ‘table.MYI’ is not fixed because of errors

Found link that points at 3255307777713450285 (outside data file) at 5452192
Found link that points at 4049971247778783536 (outside data file) at 5452292
Found link that points at 3255307777713450285 (outside data file) at 5452328
Found link that points at 3978981059712844344 (outside data file) at 5452468
Found link that points at 3978981059712844344 (outside data file) at 5452648
Found link that points at 3978981059712844344 (outside data file) at 5453176
Found link that points at 3978981059712844344 (outside data file) at 5453356
Found block with too small length at 5653824; Skipped
myisamchk: error: Not enough memory for blob at 5656088 (need 1903522412)

While the fix seems obvious (increase the myisam_sort_buffer_size), it’s a bit confusing. The server has both variables, myisam_sort_buffer_size and sort_buffer_size. The first one is the one used for the buffer that is used in “Repair by sort”. Second one is used to buffer a filesort. The ‘myisamchk’ command does NOT have myisam_sort_buffer_size. Myisamchk has ONLY sort_buffer_size, which is used for “Repair by sort”.

The following increases the buffer size that is needed.

myisamchk -o -f tables.MYI –sort_buffer_size=4G

Or increase the memory, if it’s still not sufficient to do the repair. Please your host have enghou memory, and you can copy table to a big memory host and repair it.

Tagged with:
Mar 21

In my mysql log file appear “Incorrect information in file xxxx.frm” error information.

I try myisamchk fix my talbe

myisamchk -r -q tablename

But the table is bad yet.

frm file only a table struct. So I create a same struct’s new table and copy the new frm file and overwrite bad frm file.

Exciting the bad table is restored.

Tagged with:
Jan 16

Background:

Assuming such a situation, you are a company mysql-DBA, one day all of a sudden the company database was artificially deleted.

Despite the backup, but the service is stopped due to damage caused tens of millions, and now companies need to find out that people who do the delete operation.

However, permission to have database operations a lot of people, how to troubleshoot, Where is the evidence?

Is not that powerless?

mysql itself does not operate the audit function, it is not the means in which case nothing with it?

This article will discuss a simple, ideas for mysql access to the audit.

Keywords: init-connect, binlog, trigger

Overview:

In fact, in itself mysql sql to provide a detailed implementation of records-general log, but it has several drawbacks open

Sql syntax error regardless of whether, if carried out will be recorded, leading to record a lot of useless information, post-screening difficult.

sql concurrency is large, log io record will cause some the impression that the database efficiency.

Rapid expansion of the log file is easy, do not properly handle disk space will cause a certain extent.

This point of view:

Init-connect + binlog using the method of operation of the audit mysql.

As mysql binlog longevity record of all the actual changes to the database sql statement, its execution time, and connection_id But there is no corresponding record connection_id detailed user information.

This article will init-connect, in the initial stage of each connection, the connection of the user record, and connection_id information.

Conduct audits in the latter track, in accordance with the behavior recorded binlog connection-id and the corresponding log records connected with the analysis before, draw final conclusions.

Text:

1. Set init-connect

1.1 create table for sotre user connect log

CREATE DATABASE accesslog;

CREATE TABLE accesslog.accesslog (`id` int(11) primary key auto_increment, `time` timestamp, `localname` varchar(30), `matchname` varchar(30));

1.2 create user for read log infomation

GRANT READ ON accesslog.* to root@localhost identified by ‘password’

1.3 set init-connect

        open my.cnf and at [mysqld] add fllow line

log-bin

init-connect=’insert into accesslog.accesslog values(connection_id(),user(),current_user(),now());’

1.4 restart mysqld

shell>service mysqld restart

2. Record Tracking

 

2.1 thread_id confirmed

Suppose want to know November 25, 2009, more than 9 am when it test.dummy this table who deleted the.  The following statement can be positioning

mysqlbinlog –start-datetime=’2009-11-25 09:00:00′ –stop-datetime=’2009-11-25 09:00:00′ binlog.xxxx | grep ‘dummy’ -B 5

Will get the following results (see thread_id 5):

# at 300777

#091124 16:54:00 server id 10 end_log_pos 301396 Query thread_id=5 exec_time=0 error_code=0

SET TIMESTAMP=1259052840;

drop table test.dummy;

 2.2 the user to confirm

thread_id recognized, find the culprit is just a question of a sql statement.

select * from accesslog.accesslog where conn_id=5 ; select * from accesslog.accesslog where conn_id = 5;

Can be found testuser2 @ localhost dry out.

+——+——————————-+———

| Id | time | localname | matchname |

+——+——————————-+———

| 5 | 2009-11-25 10:57:39 | testuser2@localhost | testuser2@% |

+——+——————————-+———

3. Q & A

Q: using init-connect can affect server performance?

A: In theory, the only connection to the database each time a user to insert a record, will not have a significant impact on the database.  Unless the connection is very high frequency (of course, need to pay attention this time is how to reuse the connection and control, rather than the use of this method is not the problem)

Q: access-log table how to maintain?

A: Because it is a log system, the recommended archive storage engine will help Ecuador compressed data storage.  If the large number of database connection, I suggest a certain time to do a data export, and then clear the table.

Q: What table has other uses?

A: Yes!  access-log table, of course not only for the audit, of course, can also be used for the database connection for data analysis, such as distribution of the daily number of connections, etc., not only can not think of.

Q: there will be missing records?

A: Council, init-connect is not executed when the super user login.  So there will not have access-log record of the database superuser, which is why we do not recommend more than super-user and multi-user reasons.

Tagged with:
Mar 13

We recently came across a problem with Cacti and the MySQL counters. For those of you who don’t know how to integrate MySQL statistics into Cacti have a look at this: http://code.google.com/p/mysql-cacti-templates/. These templates are a great way to gain some insight into how your MySQL database servers perform. The templates are actually PHP pages that query the databases through a variety of commands like SHOW STATUS and SHOW ENGINE INNODB STATUS.

The issue that we encountered was that some statistics like the InnoDB buffer pool activity were not displaying anything for one server. Other servers were displaying it just fine and other statistics for that server were also fine.

Among other things the SHOW ENGINE INNODB STATUS command shows deadlock information pertaining to the last deadlock that the InnoDB engine encountered. In some cases this information will be quite extensive and this causes a problem. The output of this command is one giant text field with a limit of 64KB. If the deadlock information is very large other information will get cut off which means certain statistics are lost. The easy fix for this is to restart the database server but in case this is not an option you can always use the innotop utility to wipe the deadlock information by causing a small deadlock.

Tagged with:
Mar 09

Here’s an interesting one, what if you have a MySQL replication setup and the slave stops replicating with a syntax error? The slave should be executing the exact same commands as the master, right? Well, as it turns out, yes and no. There is a bug in MySQL that has been fixed in 5.0.56 according to the bug report. It’s a long story and it’s worth the read but what happens is that a timeout in the network connection between the master and the slave can cause the master to resend part of packet that it sent before. The slave handled the previous packet correctly so it’s not expecting a resend and as a result it starts writing some garbage to the relay log (which is where it stored the statements it will execute). The SQL command gets mangled in the process and when the slave tries to execute it, voila, a syntax error.

To fix this you can use the CHANGE MASTER command to set the slave to the master bin log file and position that shows up in the SHOW SLAVE STATUS output. Make sure you use the Relay_Master_Log_File and Exec_Master_Log_Pos fields since they indicate what position in the master binlog the slave actually thought it was executing. Keep in mind that corruption and its effects are hard to predict. It will definitely be useful to compare the master and slave afterward using the MaatKit tools.

As some more background, the server log will be probably show and error like this to indicate there was a network error:
[ERROR] Error reading packet from server: Lost connection to MySQL server during query (server_errno=2013)

And finally, if you do read the entire bug thread you will notice that the original developer of MySQL also has an opinion on this.

Tagged with:
Mar 03

If you want to grant remote access privileges to a DB on your server,Please look fllow.

First login trough SSH on your server and get access to you mysql

$mysqladmin -u xxx password  xxx

Note: the db user and db passwd are your database username and database password

GRANT ALL PRIVILEGES ON db_base.* TO db_user @’%’ IDENTIFIED BY ‘db_passwd’;

You can also grant accesss to a specific IP adress

GRANT ALL PRIVILEGES ON failserv_example.* TO failserver@’xx.xx.xx.xx’ IDENTIFIED BY ‘db_passwd’;

(where x is your own remote IP)

Refresh privileges,After that to activate your setting type

FLUSH PRIVILEGES;

And exit your mysql

$mysql>quit

Tagged with:
Dec 17

Description:
Currently the number of fd’s on windows is limited to 2048.
This is bad for performance, for many reasons, mostly windows servers
are stuck with a tiny table_cache or low number of concurrent connections,
compared with linux running on the same hardware.

Error Log:
Could not increase number of max_open_files to more than 2048 (request: 3082)

Othre Error:

ERROR 1135: Can’t create a new thread (errno 11). If you are not out of available memory, you can consult the manual for a possible OS-dependent bug

How to repeat:
Run the server

mysqld-nt.exe –table_cache=1000 –max_connections=500 –open_files-limit=3000 –console

061122 17:04:27 [Warning] Could not increase number of max_open_files to more than 2048
(request: 2510)
061122 17:04:28  InnoDB: Started; log sequence number 0 43655
061122 17:04:28 [Note] mysqld-nt: ready for connections.
Version: ’5.0.30-enterprise-gpl-nt’  socket: ”  port: 3306  MySQL Enterprise Server
(GPL)

More:http://bugs.mysql.com/bug.php?id=24509

Solution:

1.Update Your Mysql Server to Mysql5.5,It has been fix is released in 5.5.

2.Replacement of the operating system,Linux have not the problem.

Tagged with:
Dec 02

Mysql Full Backup Script, Hope it can help you.

#!/bin/sh
###################################################################
# Name:Mysql_Full_Backup.sh
# PS:MySQL DataBase Full Backup.
# Write by:Jason
# Last Modify:2009-11-20
###################################################################

# Define Variable Please Modify By Fact
# Define Script Directory
scriptsDir=/home/Script

# Define Database Directory
mysqlDir=/srv/mysql

# Define Database User & Name
user=bkuser
userPWD=pwd

# Define Backup Directory
dataBackupDir=/home/mysqlbackup

# Define Email Content
eMailFile=$dataBackupDir/email.txt

# Define Email Address
eMail=xxxx@mail.com

# Define Backup Log File.
logFile=$dataBackupDir/mysqlbackup.log
DATE=`date -I`

echo "" > $eMailFile
echo $(date +"%y-%m-%d %H:%M:%S") >> $eMailFile
cd $dataBackupDir

# Define Backup Filename.
dumpFile=database_$DATE.sql
GZDumpFile=database_$DATE.sql.tar.gz

# Backup Database By mysqldump
$mysqlDir/bin/mysqldump -u$user -p$userPWD \
–opt –default-character-set=gbk –extended-insert=false \
–triggers -R –hex-blob –all-databases \
–flush-logs –delete-master-logs \
–lock-all-tables > $dumpFile

# Compress Backup File

if [[ $? == 0 ]]; then
  tar czf $GZDumpFile $dumpFile >> $eMailFile 2>&1
  echo "BackupFileName:$GZDumpFile" >> $eMailFile
  echo "DataBase Backup Success!" >> $eMailFile

  rm -f $dumpFile

# Delete daily backup files.
#  cd $dataBackupDir/daily
#  rm -f *

# Delete old backup files(mtime>2).
#  $scriptsDir/rmBackup.sh

# Move Backup Files To Backup Server.
$scriptsDir/Rsync_Backup.sh

  if (( !$? )); then
    echo "Move Backup Files To Backup Server Success!" >> $eMailFile
    else
    echo "Move Backup Files To Backup Server Fail!" >> $eMailFile
  fi
else
  echo "DataBase Backup Fail!" >> $emailFile
fi

# Write Log File…
#echo "——————————————————–" >> $logFile

cat $eMailFile >> $logFile

# Notify ADMIN by Email.
#cat $eMailFile | mail -s "MySQL Backup" $eMail

Tagged with:
Aug 06

Of course, the data you put into MySQL can be any language you want, but many people around the world who do not speak English as a first language use MySQL. MySQL AB, the company now responsible for MySQL, is based in Sweden, and most of the primary developers are Scandinavian. So, it comes as no surprise that MySQL distributions come with support for other languages. The following languages are currently supported, and more are likely to be added: Czech, Danish, Dutch, English (the default), Estonian, French, German, Greek, Hungarian, Italian, Korean, Norwegian, Norwegian-ny, Polish, Portuguese, Romanian, Russian, Slovak, Spanish, and Swedish.

Displaying Error Messages in Another Language

Starting MySQL so that it displays error messages in one of these languages is as easy as using
the –language or -L options at startup. To do so in the config file, simply add a line such as the following:

language=french

You can also edit the error messages yourself (perhaps you want your database to have that personal touch) or contribute your own set in another language, and give something back to the MySQL community. To change the error messages, simply edit the errmsg.txt file in the appropriate language directory (usually /share/language_name from the MySQL base directory), run the cmp_error utility, and restart the server. For example:

% cp errmsg.txt errmsg.bak
% vi errmsg.txt

Here I edited the error message that read as follows:

"No Database Selected",

to read as follows instead:

"Haven't you forgotten something - No Database Selected",

and then saved it:

"errmsg.txt" 229 lines, 12060 characters written
% comp_err errmsg.txt errmsg.sys
Found 226 messages in language file errmsg.sys

Then restart the server, and the new error messages will take effect:

% mysqladmin shutdown
% /etc/rc.d/init.d/mysql start
% mysql -uroot -pg00r002b
mysql> SELECT * FROM a;
ERROR 1046: Haven't you forgotten something - No Database Selected

You’ll have to repeat the changes if you upgrade to a newer version of MySQL.

Using a Different Character Set

By default, MySQL uses the Latin1 (ISO-8859-1) character set. The character set determines what characters can be used, as well as the sorting order for queries. You can change the character set by changing the value of the –default-character-set option when you start the server. The available character sets currently include the following:

latin1

dos

estonia

big5

german1

hungarian

czech

hp8

koi8_ukr

euc_kr

koi8_ru

win1251ukr

gb2312

latin2

greek

gbk

swe7

win1250

latin1_de

usa7

croat

sjis

cp1251

cp1257

tis620

danish

latin5

ujis

hebrew

 

dec8

win1251

 

You can see what character sets are available in your distribution by looking at the value of the character_sets variable.

When you change a character set, you’ll need to rebuild your indexes to ensure they sort according to the rules of the new character set.

By default, MySQL is compiled with –with-extra-charsets=complex, which makes the other character sets available if necessary. If you are compiling MySQL yourself, and you know you are never going to need other character sets, you can use the –with-extra-charsets=none option.

Adding Your Own Character Set

You can add your own character set as well. If it is a simple character set and does not need multibyte character support or string collating routines for sorting, adding it is easy. It becomes more complex if these extras are required. To add a character set, perform the following steps:

  1. Add the new character set to the sql/share/charsets/Index file, and give it a unique ID. The path may differ on some distributions, but it’ll always be the Index file. Here, you can call the new character set martian, with an ID of 31:

    # sql/share/charsets/Index
    #
    # This file lists all of the available character sets.
    
    big5               1
    czech              2
    dec8               3
    dos                4
    german1            5
    hp8                6
    koi8_ru            7
    latin1             8
    latin2             9
    swe7              10
    usa7              11
    ujis              12
    sjis              13
    cp1251            14
    danish            15
    hebrew            16
    # The win1251 character set is deprecated.  Please use cp1251 instead.
    win1251           17
    tis620            18
    euc_kr            19
    estonia           20
    hungarian         21
    koi8_ukr          22
    win1251ukr        23
    gb2312            24
    greek             25
    win1250           26
    croat             27
    gbk               28
    cp1257            29
    latin5            30
    martian           31
  2. Create the .conf and place it in the directory, for example, sql/share/charsets/martian.conf. Use one of the existing .conf files as a starting point for this.

    In the .conf file, lines beginning with a # are comments, words are separated by any amount of whitespace, and every word must be in hexadecimal format. There are four arrays. In order, they are ctype (containing 257 elements), to_lower and to_upper (each containing 256 elements), and sort_order (also containing 256 elements). The following is a sample .conf file (this is the standard latin1.conf):

    # Configuration file for the latin1 character set
    
    # ctype array (must have 257 elements)
      00
      20  20  20  20  20  20  20  20  20  28  28  28  28  28  20  20
      20  20  20  20  20  20  20  20  20  20  20  20  20  20  20  20
      48  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10
      84  84  84  84  84  84  84  84  84  84  10  10  10  10  10  10
      10  81  81  81  81  81  81  01  01  01  01  01  01  01  01  01
      01  01  01  01  01  01  01  01  01  01  01  10  10  10  10  10
      10  82  82  82  82  82  82  02  02  02  02  02  02  02  02  02
      02  02  02  02  02  02  02  02  02  02  02  10  10  10  10  20
      00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
      00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
      48  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10
      10  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10
      01  01  01  01  01  01  01  01  01  01  01  01  01  01  01  01
      01  01  01  01  01  01  01  10  01  01  01  01  01  01  01  02
      02  02  02  02  02  02  02  02  02  02  02  02  02  02  02  02
      02  02  02  02  02  02  02  10  02  02  02  02  02  02  02  02
    
    # to_lower array (must have 256 elements)
      00  01  02  03  04  05  06  07  08  09  0A  0B  0C  0D  0E  0F
      10  11  12  13  14  15  16  17  18  19  1A  1B  1C  1D  1E  1F
      20  21  22  23  24  25  26  27  28  29  2A  2B  2C  2D  2E  2F
      30  31  32  33  34  35  36  37  38  39  3A  3B  3C  3D  3E  3F
      40  61  62  63  64  65  66  67  68  69  6A  6B  6C  6D  6E  6F
      70  71  72  73  74  75  76  77  78  79  7A  5B  5C  5D  5E  5F
      60  61  62  63  64  65  66  67  68  69  6A  6B  6C  6D  6E  6F
      70  71  72  73  74  75  76  77  78  79  7A  7B  7C  7D  7E  7F
      80  81  82  83  84  85  86  87  88  89  8A  8B  8C  8D  8E  8F
      90  91  92  93  94  95  96  97  98  99  9A  9B  9C  9D  9E  9F
      A0  A1  A2  A3  A4  A5  A6  A7  A8  A9  AA  AB  AC  AD  AE  AF
      B0  B1  B2  B3  B4  B5  B6  B7  B8  B9  BA  BB  BC  BD  BE  BF
      E0  E1  E2  E3  E4  E5  E6  E7  E8  E9  EA  EB  EC  ED  EE  EF
      F0  F1  F2  F3  F4  F5  F6  D7  F8  F9  FA  FB  FC  FD  FE  DF
      E0  E1  E2  E3  E4  E5  E6  E7  E8  E9  EA  EB  EC  ED  EE  EF
      F0  F1  F2  F3  F4  F5  F6  F7  F8  F9  FA  FB  FC  FD  FE  FF
    
    # to_upper array (must have 256 elements)
      00  01  02  03  04  05  06  07  08  09  0A  0B  0C  0D  0E  0F
      10  11  12  13  14  15  16  17  18  19  1A  1B  1C  1D  1E  1F
      20  21  22  23  24  25  26  27  28  29  2A  2B  2C  2D  2E  2F
      30  31  32  33  34  35  36  37  38  39  3A  3B  3C  3D  3E  3F
      40  41  42  43  44  45  46  47  48  49  4A  4B  4C  4D  4E  4F
      50  51  52  53  54  55  56  57  58  59  5A  5B  5C  5D  5E  5F
      60  41  42  43  44  45  46  47  48  49  4A  4B  4C  4D  4E  4F
      50  51  52  53  54  55  56  57  58  59  5A  7B  7C  7D  7E  7F
      80  81  82  83  84  85  86  87  88  89  8A  8B  8C  8D  8E  8F
      90  91  92  93  94  95  96  97  98  99  9A  9B  9C  9D  9E  9F
      A0  A1  A2  A3  A4  A5  A6  A7  A8  A9  AA  AB  AC  AD  AE  AF
      B0  B1  B2  B3  B4  B5  B6  B7  B8  B9  BA  BB  BC  BD  BE  BF
      C0  C1  C2  C3  C4  C5  C6  C7  C8  C9  CA  CB  CC  CD  CE  CF
      D0  D1  D2  D3  D4  D5  D6  D7  D8  D9  DA  DB  DC  DD  DE  DF
      C0  C1  C2  C3  C4  C5  C6  C7  C8  C9  CA  CB  CC  CD  CE  CF
      D0  D1  D2  D3  D4  D5  D6  F7  D8  D9  DA  DB  DC  DD  DE  FF
    
    # sort_order array (must have 256 elements)
      00  01  02  03  04  05  06  07  08  09  0A  0B  0C  0D  0E  0F
      10  11  12  13  14  15  16  17  18  19  1A  1B  1C  1D  1E  1F
      20  21  22  23  24  25  26  27  28  29  2A  2B  2C  2D  2E  2F
      30  31  32  33  34  35  36  37  38  39  3A  3B  3C  3D  3E  3F
      40  41  42  43  44  45  46  47  48  49  4A  4B  4C  4D  4E  4F
      50  51  52  53  54  55  56  57  58  59  5A  5B  5C  5D  5E  5F
      60  41  42  43  44  45  46  47  48  49  4A  4B  4C  4D  4E  4F
      50  51  52  53  54  55  56  57  58  59  5A  7B  7C  7D  7E  7F
      80  81  82  83  84  85  86  87  88  89  8A  8B  8C  8D  8E  8F
      90  91  92  93  94  95  96  97  98  99  9A  9B  9C  9D  9E  9F
      A0  A1  A2  A3  A4  A5  A6  A7  A8  A9  AA  AB  AC  AD  AE  AF
      B0  B1  B2  B3  B4  B5  B6  B7  B8  B9  BA  BB  BC  BD  BE  BF
      41  41  41  41  5C  5B  5C  43  45  45  45  45  49  49  49  49
      44  4E  4F  4F  4F  4F  5D  D7  D8  55  55  55  59  59  DE  DF
      41  41  41  41  5C  5B  5C  43  45  45  45  45  49  49  49  49
      44  4E  4F  4F  4F  4F  5D  F7  D8  55  55  55  59  59  DE  FF

    The ctype array contains bit values, with one element for one character. The to_lower and to_upper arrays simply hold the uppercase and lowercase characters that correspond to each member of the character set. For example, to_lower['A'] contains a, while to_upper['z'] contains Z.

    The sort_order array indicates the order that characters are to be sorted (it usually corresponds to to_upper, in which case the sorting will be case insensitive. All of the arrays are indexed by character value, except ctype, which is indexed by character value + 1 (an old legacy).

  3. Add the new character set (martian.conf) to the CHARSETS_AVAILABLE and COMPILED_CHARSETS lists in the file configure.in.

  4. Reconfigure and recompile MySQL, and test the new character set.

If you’re brave enough to tackle adding a new complex character set, there are a few more steps to this process. See the MySQL documentation for what is required (as well as the documentation in the existing complex character sets: czech, gbk, sjis, and tis160).

Summary

To understand how to get the most out of your database server, it’s important to understand the number of options you have when fine-tuning the server. To see how an existing server has been set up, use the SHOW VARIABLES statement, as well as SHOW STATUS to see how it’s been handling. The output of these two statements can reveal many hidden problems, including queries that are not optimized, poor use of available memory, or simply that it’s time for an upgrade.

MySQL supplies four configuration files that can help to get better performance from the server. Just choose the closest of my-huge.cnf, my-large.cnf, my-medium.cnf or my-small.cnf for your server situation.

Two of the easiest and most important variables to tweak are table_cache (the number of tables MySQL can keep open) and the key_buffer_size (how much of the indexes MySQL can keep in memory, minimizing disk access).

InnoDB databases have their own vagaries and work in a fundamentally different way than MyISAM tables, where each table is related to specific files. InnoDB configuration requires careful planning because disk space is allocated in advance.

Hardware too can be an easy way of improving the performance of a server, with memory, CPU, and disks being of primary importance.

MySQL comes with a benchmark suite, which can be used to compare the performance of various platforms, including other databases.

MySQL was developed in Scandinavia and has had good support for other languages besides English. It is easy to display error messages in other languages or add a character set.

Tagged with:
preload preload preload