mysql 5.5.x zip Direct Unzipped version installation method
- 2020-12-22 17:48:28
- OfStack
Download ES1en-5.5.10-ES2en32.zip to the official website, and then unzip mysql to any path, such as C:\ ES6en-5.5.10-win32
Turn on the computer -
>
Property -
>
Advanced system Settings -
>
Create a new environment variable named MYSQL_HOME with the value of your mysql root, C:\ ES17en-5.5.10-ES18en32
Then in the system variable Path add:; %MYSQL_HOME%\bin
There are several ini files that start with "my-" already written under the root directory. Choose one that works for you, such as my-ES29en.ini. Make a copy, change the file name to ES31en.ini, and add the following:
[mysqld]
# Set the character set to utf8
default-character-set = utf8
basedir = C:/mysql-5.5.10-win32
datadir = C:/mysql-5.5.10-win32/data
[client]
# Set the client character set
default-character-set = utf8
[WinMySQLadmin]
Server = C:/mysql-5.5.10-win32/bin/mysqld.exe
Open the command prompt, enter the %MYSQL_HOME%/bin directory, and execute the command: ES39en-ES40en to install mysql to windows's service. After successful execution, C:\ ES44en-5.5.10-win32 \bin
>
Service successfully installed.
If you want to uninstall the service execute command: ES50en-ES51en.
Then execute net start mysql at the command prompt to start mysql and stop the service by typing net stop mysql. If you want to set whether mysql starts automatically, you can do so in the Start menu - > Enter ES63en. msc to open service management for setting.
Enter on the first login:
C:\Users\Administrator > mysql -u root
Change password:
mysql
>
update mysql.user set password=PASSWORD('root') where User='root'
mysql
>
flush privileges
However, I still had a small problem during the installation process. When I started mysql, I reported an error:
System error.
A system error 1067 has occurred.
The process terminates unexpectedly.
Open the username.err file in the directory %MYSQL_HOME%/data, where the error log for mysql is recorded. I found this sentence in it:
110327 0:12:02 [ERROR] MySQL: unknown variable 'default-character-set=utf8'
It feels strange, 1 always installed like this before. Finally, I found a help message for DBA on the official website of mysql. It turned out that this was a new version of bug, and it was not supported to set the character set as utf8 in ES107en.ES108en. The solution is to add loose- before ES110en-ES111en-ES112en =utf8:
[mysqld]
# Set the character set to utf8
loose-default-character-set = utf8
[client]
# Set the client character set
loose-default-character-set = utf8
The startup no longer reports an error... The original address of the request for help:
http://forums.mysql.com/read.php?103,189835,237318
Postscript:
Although loose- is added in the same way as above, mysql starts no longer report errors. But when inserting data, there was still the problem of messy code, which caused me a lot of trouble.
mysql
>
show variables like '%char%';
Through the above command to check the character set encoding, the following results are obtained:
+--------------------------+---------------------------------------+
| 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 the encoding of character_set_database and character_set_server is still the default latin1.
Add ES166en-ES167en-ES168en = utf8 under the [mysqld] configuration option and restart the service to enter mysql 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 problem solving