MySQL 5.5.x Zip Direct decompression version installation method _mysql

Source: Internet
Author: User

Download Mysql-5.5.10-win32.zip to the official website, and then extract the MySQL to any path, such as: C:\mysql-5.5.10-win32

Turn on the computer-> properties-> advanced system settings-> environment variable, create a new environment variable named: mysql_home, Variable value for your MYSQL root directory, such as: C:\mysql-5.5.10-win32
Then add in the system variable path:;%mysql_home%\bin

Below the root directory are several already written "my-" the beginning of the INI file, choose a suitable for you, such as: My-small.ini. Duplicate a copy, modify the filename to My.ini, and add the following:

[Mysqld] 
#设置字符集为utf8 
default-character-set = UTF8 
basedir = c:/mysql-5.5.10-win32 
DataDir = C:/mysql-5.5.10-win32 /data 
 
[client] 
#设置客户端字符集 
default-character-set = UTF8 
 
[winmysqladmin] 

Open a command prompt, enter the%mysql_home%/bin directory, and execute the command:mysqld-install installs MYSQL to Windows services. After successful execution will prompt: C:\mysql-5.5.10-win32\bin>service successfully installed.
If you want to uninstall the Service execution command:mysqld-remove.

Then execute at the command prompt: net start MySQL can start MySQL, stop service input command: net stop MySQL. If you want to set whether MySQL starts automatically, you can set it up by entering Service.msc Open service Management in the Start menu-> run.

The first time you log in, enter:

C:\users\administrator>mysql-u Root

Modify Password:

mysql> Update mysql.user set Password=password (' root ') where user= ' root '
mysql> Flush Privileges

However, I still have a little problem in the installation process, when the start of MySQL error:

System error.

A system error 1067 occurred.

The process terminated unexpectedly.

Open the user name. err file in the%mysql_home%/data directory, and the MYSQL error log is recorded in this file. Found in the inside such a sentence:

110327 0:12:02 [ERROR] mysql:unknown variable ' Default-character-set=utf8 '

It's strange, it's been installed like this all along. Finally, on the MySQL official web site to find a Chinese DBA for help information, originally this is a new version of a bug, do not support the My.ini set in the direct setting of UTF8. The solution is: add loose-to the front of the Default-character-set=utf8:

[Mysqld] 
#设置字符集为utf8 
loose-default-character-set = UTF8 
 
[client] 
#设置客户端字符集 

Start really no longer the error ... The original address of the Help information:
http://forums.mysql.com/read.php?103,189835,237318

Postscript:

Although use the above way to join loose-, MySQL startup no longer complains. However, when inserting data, there is still a garbled problem, which caused me no small trouble.
Mysql> Show variables like '%char% ';
View the character set encoding from the above command and 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 encoding or the default latin1.

Add character-set-server = UTF8 under [mysqld] configuration options, restart service into MySQL to view 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\ |
+--------------------------+---------------------------------------+

Perfect solution to the problem

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.