Set Optimal MySQL Configuration in my.cnf



First, you need to open my.cnf file. The following is the query to get the directory location of the config file on Windows −

mysql> select @@datadir;

Output

+---------------------------------------------+
| @@datadir                                   |
+---------------------------------------------+
| C:\ProgramData\MySQL\MySQL Server 8.0\Data\ |
+---------------------------------------------+
1 row in set (0.00 sec)

Here is the snapshot of the directory −

Now open my.cnf file. The snapshot is as follows −

If you want to add more data to cache, then use the following query −

innodb_buffer_pool_size = 1024M

If you want to write more data, then use the following query −

innodb_log_file_size = 512M

We have set both the above options in my.conf file as shown below −

Updated on: 2019-07-30T22:30:25+05:30

215 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements