Set Optimal MySQL configuration in my.cnf?

MySQLMySQLi Database

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 −

raja
Published on 19-Mar-2019 07:58:50
Advertisements