简体   繁体   中英

How to configure my.cnf in 5.6.17?

On production server(linux machine mysql 5.6.17), I tried to find my.cnf to change the system variables, but my.cnf was not in /etc/my.cnf location. It was in usr/ directory. Also that file contains only comments like -

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

Please tell me where should I copy my.cnf and how I can change variables like -

innodb_buffer_pool_size = 200M
max_connections = 300

There are various ways you can modify global variables like that.

In your my.cnf file

Add/edit the values under the [mysqld] block, so;

[mysqld]
innodb_buffer_pool_size = 200M
max_connections = 300

Then restart the mysqld daemon for changes to take affect.

Running a query

You can run the following queries to change the values for those variables, but there will be reset to default once mysqld daemon restarts/server is rebooted/etc.

SET GLOBAL innodb_buffer_pool_size = 200M;
SET GLOBAL max_connections = 300;

You can read more about that here: http://dev.mysql.com/doc/refman/5.0/en/using-system-variables.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM