
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 −
Advertisements