MySQL Tutorial
MySQL Installation and Configuration
MySQL Database Operations
Database Design
MySQL Data Types
MySQL Storage Engines
MySQL Basic Operations of Tables
MySQL Constraints
MySQL Operators
MySQL Function
MySQL Manipulate Table Data
MySQL View
MySQL Indexes
MySQL Stored Procedure
MySQL Trigger
MySQL Transactions
MySQL Character Set
MySQL User Management
MySQL Database Backup and Recovery
MySQL Log
MySQL Performance Optimization
Under normal circumstances, my.ini is in the root directory of the MySql installation, and it may also be in the hidden folder "ProgramData".
[client] port=3306 [mysql] default-character-set=gbkThe above shows the parameters of the client. [client] and [mysql] are both clients. The parameters are described as follows:
[mysqld] port=3306 basedir=C:/Program Files/MySQL/MySQL Server 5.7/ datadir=C:/ProgramData/MySQL/MySQL Server 5.7/Data character-set-server=gb2312 default-storage-engine=INNODB sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" max_connections=100 query_cache_size=0 table_cache=256 tmp_table_size=35M thread_cache_size=8 myisam_max_sort_file_size=100G myisam_sort_buffer_size=69M key_buffer_size=55M read_buffer_size=64K read_rnd_buffer_size=256K sort_buffer_size=256KThe above are the parameters of the server. The parameter descriptions are shown in the following table:
parameter name | illustrate |
---|---|
port | Indicates the port number of the MySQL server |
basedir | Indicates the installation path of MySQL |
datadir | Indicates the storage location of MySQL data files, and also the storage location of data tables |
default-character-set | Indicates the server-side default character set |
default-storage-engine | When creating a data table, the default storage engine used |
sql-mode | Indicates the parameter of the SQL mode, through which the strictness of the SQL statement can be set |
max_connections | Indicates the maximum number of connections allowed to access the MySQL server at the same time. One of the connections is reserved, reserved for the exclusive use of the administrator |
query_cache_size | Indicates the size of the cache at the time of query. The cache can store information previously queried through the SELECT statement. When querying again, the information can be directly retrieved from the cache, which can improve query efficiency. |
table_open_cache | Indicates the total number of open tables for all processes |
tmp_table_size | Indicates the maximum size allowed for each temporary table in memory |
thread_cache_size | Indicates the maximum number of threads to cache |
myisam_max_sort_file_size | Indicates the maximum size of temporary files allowed by MySQL when rebuilding indexes |
myisam_sort_buffer_size | Indicates the cache size when rebuilding the index |
key_buffer_size | Indicates the cache size of the keyword |
read_buffer_size | Indicates the size of the cache for full table scans of MyISAM tables |
read_rnd_buffer_size | Indicates that the sorted data is stored in the cache |
sort_buffer_size | Indicates the size of the cache used for sorting |
innodb_additional_mem_pool_size=3M innodb_flush_log_at_trx_commit=1 innodb_log_buffer_size=2M innodb_buffer_pool_size=107M innodb_log_file_size=54M innodb_thread_concurrency=18The above are the parameters used by the InnoDB storage engine. The parameter descriptions are as follows:
Edit my.ini for MySQL Configuration on Windows:
my.ini
file using a text editor to adjust MySQL server settings on Windows.notepad "C:\Program Files\MySQL\MySQL Server X.Y\my.ini"Adjust the path based on your MySQL installation.
Changing Buffer Settings in my.ini:
innodb_buffer_pool_size
in the my.ini
file to optimize MySQL's use of memory.my.ini
and set values, e.g.:innodb_buffer_pool_size = 256M
Reload my.ini Without Restarting MySQL on Windows:
mysqladmin -u root -p shutdown mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"Adjust the path based on your MySQL installation.