Windows operating system, when we install the MySQL database server, there are usually two choices: first, go to the official website to download Mysql-installer.exe, using the Windows System Installer method to install The second is to go to the software community to download the MySQL Green free installation version, extracted can be used immediately.
Both of the above can be successfully installed on the computer MySQL server, however, some users use the free installation version, not through the correct configuration to start the MySQL server, the problem is when we want to modify the database configuration information such as Wait_timeout, interactive_ Timeout, max_connections, but could not find the My.ini configuration file. MySQL root directory only my_default.ini file, open this My_default.ini file, it seems can also configure information.
When we modified the configuration in this Default.ini file, after restarting the database, we cried and found that the newly modified configuration did not work. Although at this point, you can also modify the configuration information through the command line, but after restarting the MySQL changes will be effective, the configuration will be returned to the default, the command-line modification of the way a palliative. Not as a solution, how to do?
Here's another way to solve the problem described above, which is the kind of trouble you might be experiencing right now. The basic idea is to remove the MySQL service first, then create a new copy of the My.ini file, and then reinitialize the MySQL service using the command line, specifying the new My.ini as the default configuration file for the service. Here are the detailed steps:
1. Delete the MySQL service, open the command line, enter the following instructions
SC Delete MYSQL
"MYSQL" for the service name, your Myssql service is not necessarily the name, you can open services.msc view
2. In the MySQL root directory, create a new My.ini file, enter the contents of the file
# for advice The Change settings see# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html# * * * Don't EDIT this FILE. It's a template which 'll be copied to the# * * * default location duringInstall, and would be replacedifyou#***upgrade to a newer version of MySQL. [Client]default-character-set =Utf8mb4[mysql]default-character-set =Utf8mb4[mysqld]character-set-client-handshake =Falsecharacter-set-server =utf8mb4collation-server =Utf8mb4_unicode_ciinit_connect='SET NAMES utf8mb4'# Remove Leading # and set to the amount of RAM forThe most important data# cacheinchMysql. Start at -% of Total RAM forDedicated server,Else Ten%. Innodb_buffer_pool_size=128m# Remove Leading # to turn on a very important data integrity option:logging# changes to the binary log between backups.# log_bin# These is commonly set, remove the # and set as Required.basedir= D:\MySQL\mysql5.7DataDir= D:\MySQL\mysql5.7\dataport=3306# server_id=... # Remove leading # To set options mainly useful forreporting servers.# The server defaults is faster fortransactions and fast selects.# Adjust sizes as needed, experiment toFindThe optimal values.join_buffer_size=128msort_buffer_size=16mread_rnd_buffer_size=16M Sql_mode=no_engine_substitution,strict_trans_tables
The above Basedir and DataDir are modified according to your MySQL location.
3. Start the command line as an administrator and switch the work path to the Bin folder in the MySQL directory, as my C:\Program files\mysql\mysql Server 5.7\bin. Then execute the following command
Mysqld--initialize
The purpose of this command is to initialize the data directory
4. Then execute the following command
MYSQLD--install MySQL--defaults-file="C: \mysql\mysql Server 5.7\my.ini"
When this command finishes, the MySQL service is reinitialized, specifying the configuration file as the C:\MySQL\MySQL Server 5.7\my.ini file, which is our new file. After modifying the properties of the MYQL in this My.ini file, restart the service.
Windows MySQL free install version, modify the My_default.ini configuration file Invalid solution