The installation of MSI in MySQL 5.5.10 always fails and fails in the instance configuration. In this way, the installation can only be performed through archive.
1. First download the archive installation package for Windows (x86, 64-bit.
2. decompress the package to any directory, such as E: \ mysql server 5.5.
3. Select the *. ini file under the installation directory (select my-medium.ini here) to copy and rename it my. ini file. Add the following content:
[Client] default-character-set = utf8
[Mysqld]
Basedir = "E:/MySQL Server 5.5 /"
Datadir = "E:/MySQL Server 5.5/data/" character-set-Server = utf8
Cancel the following comments:
Innodb_data_home_dir = E: \ mysql server 5.5 \ data \\
Innodb_data_file_path = ibdata1: 10 m: autoextend
Innodb_log_group_home_dir = E: \ mysql server 5.5 \ data
Innodb_buffer_pool_size = 16 m
Innodb_additional_mem_pool_size = 2 m
Innodb_buffer_pool_size = 16 m
Innodb_additional_mem_pool_size = 2 m
4. Add E: \ mysql server 5.5 \ bin to the environment variable path;
5. Test whether MySQL can be started normally.
C: \> Cd E: \ mysql server 5.5 \
.\mysqld --console
If the message "mysqld: Ready For connectionsversion: '5. 5.9 'socket: ''port: 3306 indicates that MySQL can be started normally through the console. Now press crtl + C to end, so that you can install the service on Windows intermittently.
If MySQL is running, run the following command to end it:
.\mysqladmin -u root shutdown
6. Install the winodws service. Run the following command:
.\mysqld.exe --install MySQL5.5 --defaults-file="E:\MySQL\MySQL Server 5.5\my.ini"
net start mysql5.5
If everything is normal, the service is installed normally.
7. Modify the root password.
When MySQL is installed for the first time, the user root has not been set. Here we need to set the password for the root:
. \ Mysql-u root-P
Mysql> use MySQL;
Mysql> DESC user;
Mysql> grant all privileges on *. * to root @ "%" identified by "root"; // Add the remote connection capability to the root user.
Mysql> Update user SET Password = PASSWORD ('xxxxxx') where user = 'root ';
Mysql> select host, user, password from user where user = 'root ';
Mysql> flush privileges;
Mysql> exit
Log on to MySQL again
#. \ Mysql-u root-P
Mysql> show variables like 'Char % '; // you can check whether the 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 users and refresh Permissions
Grant all privileges on *. * To username 0 @ '%' identified by 'Password ';
Grant all privileges on *. * To username @ 'localhost' identified by 'Password ';
Grant all privileges on *. * To username @ '2017. 0.0.1 'identified by 'Password ';
# Insert into user (host, user, password) values ('localhost', 'username', 'Password ');
# Insert into user (host, user, password) values ('2017. 0.0.1 ', 'username', 'Password ');
Insert into user (host, user, password) values (': 1', 'username ','');
# Update user SET Password = PASSWORD ('Password') where user = 'username ';
Select host, user, password from user where user = 'username ';
Flush privileges;
Note: The grant command will add a new record to the user table at the same time. Therefore, you do not need to insert in to insert a new record item when using the grant command.
If you want to unify all the passwords of the user, you can use the upadte statement.
9. Create a database.
Reference: http://tech.ccidnet.com/art/1105/20041104/173233_1.html