It Ninja Turtles under Windows MySQL decompression version installation and configuration

Source: Internet
Author: User

1. Download the MySQL decompression version to the official website, then unzip the MySQL to any path, this example is put in: D:\Program files\mysql-advanced-5.6.14-win32

2. Set the environment variable to add in the system variable path:;D: \program Files\mysql-advanced-5.6.14-win32\bin

3. Under the root directory, there is an INI file that begins with "my-", optionally copying a root directory, such as: My-default.ini, and modifying the file name to My.ini, add the following:

[Mysqld]
#设置字符集为utf8
Default-character-set = UTF8
Basedir = D:/program Files/mysql-advanced-5.6.14-win32
DataDir = D:/program Files/mysql-advanced-5.6.14-win32/data

[Client]
#设置客户端字符集

Loose-default-character-set = UTF8
[Winmysqladmin]
Server = D:/program Files/mysql-advanced-5.6.14-win32/bin/mysqld.exe

4. Open a command prompt and go to D:/program Files/mysql-advanced-5.6.14-win32/bin directory, execute command: Mysqld-install install MySQL to Windows services. After successful execution, you will be prompted: Service successfully installed.

If you want to uninstall the Service execution command: Mysqld-remove.

5. Then execute at the command prompt: net start MySQL can start MySQL, stop the Service input command: net stop MySQL. If you want to set MySQL to start automatically, you can set it up in the Start menu, run, enter Service.msc to open service management.

6. When you log in for the first time, enter:
c:\users\administrator>mysql-u root
To change the password:
mysql> update Mysql.user set Password=password (' root ') where user= ' root '
mysql> flush privileges

7. If MySQL is started with an error: System error   system failure The 1067  process unexpectedly terminates
Open the user name. err file in the D:/program Files/mysql-advanced-5.6.14-win32/data directory, and the MySQL error log is recorded in this file. Found in the inside of this sentence:
110327  0:12:02 [ERROR] mysql:unknown variable ' Default-character-set=utf8 '
It feels strange to have been installed like this before. Finally, I found a Chinese DBA's help information on the MySQL official web, which is a bug in the new version, and does not support setting the character set to UTF8 directly in My.ini. The workaround is to add loose-in front of Default-character-set=utf8:

[Mysqld] #设置字符集为utf8
Loose-default-character-set = UTF8
Basedir = D:/program Files/mysql-advanced-5.6.14-win32
DataDir = D:/program Files/mysql-advanced-5.6.14-win32/data

[Client]
#设置客户端字符集
Loose-default-character-set = UTF8
[Winmysqladmin]
Server = D:/program Files/mysql-advanced-5.6.14-win32/bin/mysqld.exe

8. Although using the above method to join loose-, MySQL boot no longer error. However, the problem of garbled characters still occurs when inserting data.
Mysql> Show variables like '%char% ';
View the character set encoding from the above command to get the following result:
+--------------------------+---------------------------------------+
| variable_name | Value |
+--------------------------+---------------------------------------+
| character_set_client | UTF8 |
| character_set_connection | UTF8 |
| Character_set_database | Latin1 |
| Character_set_filesystem | binary |
| Character_set_results | UTF8 |
| Character_set_server | Latin1 |
| Character_set_system | UTF8 |
| Character_sets_dir | C:\mysql-5.5.10-win32\share\charsets\ |
+--------------------------+---------------------------------------+

You can see Character_set_database, Character_set_server's code is still the default latin1. Modify the My.ini configuration file as follows:

[Mysqld]
#设置字符集为utf8
Loose-default-character-set = UTF8
Character-set-server = UTF8
Basedir = D:/program Files/mysql-advanced-5.6.14-win32
DataDir = D:/program Files/mysql-advanced-5.6.14-win32/data

[Client]
#设置客户端字符集
Loose-default-character-set = UTF8

[Winmysqladmin]
Server = D:/program Files/mysql-advanced-5.6.14-win32/bin/mysqld.exe

Restart the service into MySQL again to view:

+--------------------------+---------------------------------------+

| variable_name | Value |

+--------------------------+---------------------------------------+
| character_set_client | UTF8 |
| character_set_connection | UTF8 |
| character_set_database | UTF8 |
| character_set_filesystem | binary |
| character_set_results | UTF8 |
| character_set_server | UTF8 |
| character_set_system | UTF8 |
| character_sets_dir | C:\mysql-5.5.10-win32\share\charsets\ |

+--------------------------+---------------------------------------+

Ok

It Ninja Turtles under Windows MySQL decompression version installation and configuration

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.