my.ini

See Database Management Systems.

There is a small text file called my.ini that is part of the MySQL or MariaDB installation.

MariaDB 10.5

The file for MariaDB users will look like this:

[mysqld]

basedir="C:/Program Files/MariaDB 10.5/"

datadir="C:/mysql/data/"

default-storage-engine=MyISAM

max_allowed_packet=40M

max_connections=3000

port=3306

sql_mode=''

explicit_defaults_for_timestamp=1

innodb_file_per_table=1

myisam_recover_options=OFF

optimizer_switch=split_materialized=off

MySQL 5.5

The files looks like this:

[mysqld]

basedir="C:/Program Files (x86)/MySQL/MySQL Server 5.5/"

datadir="C:/mysql/data/"

default-storage-engine=MyISAM

skip-innodb

max_allowed_packet=40M


MySQL 5.0

Or, if you are still using MySQL 5.0, then it might look like this:

[mysqld]

basedir="C:/Program Files/MySQL/MySQL Server 5.0/"

datadir="C:/mysql/data/"

skip-innodb


Alternate Options

If you are a power user, you can look at the examples of alternate my.ini files in the same folder. For example, open my-huge.ini and look under the [mysqld] section. Selective copying of some of those Variables above into your my.ini file would help to take advantage of a more powerful server. For example, here is a suggested my.ini file. DO NOT change the existing path of the basedir or datadir. The paths in the example below might not be the same as on your system.

[mysqld]

basedir="C:/Program Files/MySQL/MySQL Server 5.5/"

datadir="C:/mysql/data/"

default-storage-engine=MyISAM

skip-innodb

max_allowed_packet=40M

key_buffer = 384M

table_cache = 512

sort_buffer_size = 2M

read_buffer_size = 2M

read_rnd_buffer_size = 8M

myisam_sort_buffer_size = 64M

thread_cache_size = 8

query_cache_size = 32M

tmp_table_size = 32M

join_buffer_size = 128M


Because the my.ini file is the Program Files folder, you will not be allowed by Windows to edit the file directly. There are two workarounds to the Windows security issue:

  1. Launch Notepad as an administrator. Then, open the my.ini file from within Notepad by browsing to it.
  2. Copy and paste the entire my.ini file from an alternate temporary location into the target directory.

In both cases, stop the MySQL service before making the changes, and then start the service after saving the changes.