Install and configure MySQL decompress version under Windows for IT Ninja Turtles, and mysql for ninja turtles

Source: Internet
Author: User

Install and configure MySQL decompress version under Windows for IT Ninja Turtles, and mysql for ninja turtles
1. Download MySQL extract version to the official website, and then extract mysql to any path, this example in: D: \ Program Files \ mysql-advanced-5.6.14-win32

2. Set environment variables, add:; D: \ Program Files \ mysql-advanced-5.6.14-win32 \ bin in the system variable Path

3. There is an ini file starting with "my-" under the root directory, copy a file at will put in the root directory, such as: my-default.ini, change the file name to my. ini, add the following content:

[Mysqld]
# Set the character set to 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]
# Set the client Character Set

Loose-default-character-set = utf8
[WinMySQLadmin]
Server = D:/Program Files/mysql-advanced-5.6.14-win32/bin/mysqld.exe

4. Open a command prompt, enter the D:/Program Files/mysql-advanced-5.6.14-win32/bin directory, and run the command: mysqld-install to install mysql to a windows service. After the execution is successful, the system prompts: Service successfully installed.

To uninstall the service, run mysqld-remove.

5. Execute: net start mysql at the command prompt to start mysql. stop the service and enter the command: net stop mysql. To set whether mysql is automatically started, enter service. msc in the Start Menu> running to open service management.

6. Enter:
C: \ Users \ Administrator> mysql-u root
Change Password:
Mysql> update mysql. user set password = PASSWORD ('root') where User = 'root'
Mysql> flush privileges

7. If an error is reported when mysql is started: A system error occurs and a system error occurs. 1067 the process is terminated unexpectedly.
Open the user name. err file under the D:/Program Files/mysql-advanced-5.6.14-win32/data directory, and the mysql error log is recorded in this file. We found this sentence in it:
110327 0:12:02 [ERROR] MySQL: unknown variable 'default-character-set = utf8'
It seems strange that it has been installed like this before. Finally, I found a Chinese DBA help information on the mysql official website. It turned out to be a bug in the new version and does not support setting the character set to utf8 directly in my. ini. Solution: Add loose-that is:

[Mysqld] # Set the character set to 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]
# Set the client Character Set
Loose-default-character-set = utf8
[WinMySQLadmin]
Server = D:/Program Files/mysql-advanced-5.6.14-win32/bin/mysqld.exe

8. Although the preceding method is used to add loose-after mysql is started, no error is reported. However, garbled characters still occur during data insertion.
Mysql> show variables like '% char % ';
Run the preceding command to view the character set encoding. the following result is displayed:
+ -------------------------- + ----------------------------------------- +
| 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 \ |
+ -------------------------- + ----------------------------------------- +

It can be seen that character_set_database and character_set_server are still the default latin1 encoding. Modify the my. ini configuration file as follows:

[Mysqld]
# Set the character set to 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]
# Set the client Character Set
Loose-default-character-set = utf8

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

Restart the service to go to mysql and check again:

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

| 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


I downloaded the mysql decompress version and configured myini in the path to set the environment variables. The installation is also successful,

Troubleshoot-error logs and information

1. Check the System Service (Control Panel-management tools-service) and the properties of the mysql service to ensure that the startup script is similar to the following
"D: \ Program Files \ MySQL Server 5.5 \ bin \ mysqld" -- defaults-file = "D: \ Program Files \ MySQL Server 5.5 \ my. ini" MySQL

2. view the System Event Viewer (Control Panel-management tools) and record the normal or error information of Service Startup. If the mysql service is installed incorrectly, it cannot be started, troubleshoot the problem based on the error information.
3. Check the data/
An error occurred while configuring MySql installation-free direct decompression version ??

Can you tell me what it is? You don't need to install it?
 

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.