The MSI installation of MySQL 5.5.10 always fails and is never passed in the instance configuration, so it can only be installed through archive.
1, first download Windows (x86, 64-bit), ZIP Archive installation package.
2. Extract to any directory such as: E:\MySQL\MySQL Server 5.5
3. Select the *.ini file in the installation directory (select My-medium.ini here) to copy and rename the My.ini file. Add the following content:
[client]default-character-set=Utf8[mysqld]basedir="e:/mysql/mysql Server 5.5/"DataDir="e:/mysql/mysql Server 5.5/data/"Character-set-server=UTF8 Uncomment the following: Innodb_data_home_dir= E:\\mysql\\mysql Server5.5\\data\\Innodb_data_file_path= ibdata1:10m:Autoextendinnodb_log_group_home_dir= E:\\mysql\\mysql Server5.5\\datainnodb_buffer_pool_size=16minnodb_additional_mem_pool_size=2minnodb_buffer_pool_size=16minnodb_additional_mem_pool_size= 2M
4. Add E:\MySQL\MySQL Server 5.5\bin to the environment variable path;
5, test whether MySQL can start normally.
C:\>CD E:\mysql\mysql Server 5.5\
. \mysqld--console
If prompted: Mysqld:ready for connectionsversion: ' 5.5.9 ' socket: ' port:3306 ' means to start MySQL normally from the console, now press Crtl+c to end, so you can intermittently install into Windo WS service out.
If MySQL is running, you can end it with the following command:
Shutdown
6, install WINODWS service. Execute the following command:
. \mysqld.exe--install MySQL5. 5 --defaults-file="E:\MySQL\MySQL Server 5.5\my.ini"net start mysql5. 5
If everything works, the service is properly installed.
7, change the root password.
The first time you install MySQL, the user root is not set up, here to set the password for root:
. \mysql-u Root-Pmysql> UseMysql;mysql>desc User;mysql>grant all privileges on * * to [email protected]"%"Identified by"Root";//the ability to add remote connections for root. MySQL>update user Set Password = Password ('xxxxxx') Where user='Root'; MySQL>SelectHost,user,password from User where user='Root'; MySQL>Flush Privileges;mysql>Exit
Log back in to MySQL
#.\mysql-u root-p
Mysql> Show variables like ' char% '; can see if character encoding is set to UTF8
+--------------------------+-------------------------------------------------+| 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 | E:\MySQL\MySQL Server 5.5 \share\charsets\ |+--------------------------+------ -------------------------------------------+
8. Add a new user.
Reference: MySQL--add user, permission Refresh
Grant all privileges on * * to user name [email protected]'%'Identified by'Password'; grant all privileges on* * to User name @'localhost'Identified by'Password'; grant all privileges on* * to User name @'127.0.0.1'Identified by'Password';#INSERT INTO User (Host,user,password) values (' localhost ', ' username ', ' password '), #insert into user (Host,user,password) values (' 127.0.0.1 ', ' username ', ' password '); Insert into User (Host,user,password)Values(':: 1','User name',"'); #Update user Set Password = Password (' password ') where user= ' username ';SelectHost,user,password from User where user='User name'; flush privileges;
Note: The grant command also adds a new record to the user table, so the grant command does not need to insert a new record entry.
Use the UPADTE statement if you want to unify all of the user's passwords.
9. Create a database.
Reference: http://tech.ccidnet.com/art/1105/20041104/173233_1.html
MySQL5.5 installation under Windows (unzip as a folder)