You can configure MySQL to read a wide variety of startup options from a file named my.cnf
. Settings are scoped and can be overridden by file location:
Scope |
Location |
Override |
---|---|---|
global |
|
|
server-specific |
binary install: |
global |
user |
|
global, server-specific |
Below are sample settings for a simple development laptop /etc/my.cnf
:
[mysqld] socket=/var/mysql/mysql.sock default-storage-engine=InnoDB innodb_data_home_dir = /usr/local/mysql/data innodb_data_file_path=ibdata1:10M:autoextend innodb_flush_log_at_trx_commit=1 [client] socket=/var/mysql/mysql.sock