Mysql installation and configuration
I,Configure the MySQL database
1. decompress the green version of mysql and change it to mysql5.7, as shown in figure
Compare versions earlier than 5.6, less data Directories (store data) and my-default.ini files (configuration information)
Ii. Install services
1. Run cmd (administrator Version, otherwise you do not have permission), as shown in figure
2. For the new version of mysql5.7 without the data directory, run the command to create
3. Run the command mysqld-install to install the service, for example:
If you do not need mysql, you only need to run mysqld-remove to remove it, as shown in figure
3. Run net start mysql to start the service, as shown in figure
If you need to configure whether to start mysql at startup, you can configure it in the windows service.
Iii. Client Testing
1. mysql-uroot-p such
4. Change the user name and password
1. Run the command
Use mysql;
UPDATE user SET authentication_string = password ('000000') where user = 'root ';
Flush privileges;
For example:
2. Log On again and run mysql-uroot-p123456.
5. Configure the code to UTF-8
1. view the default encoding
2. In the root directory of mysql5.7, create the my. ini file. (If this file is not found after 5.7, create it by yourself.) For example:
When the Mysql service starts, it automatically reads my. ini to obtain configuration parameters, including encoding.
2. edit my. ini
Under the [mysqld] node, configure the server encoding and add two items.
Character_set_server = utf8
[Mysql] node, which is used to configure client information
We also add a [mysql] node and configure the UTF-8 encoding.
[Mysql]
Default-character-set = utf8
For example:
6. Test Query
1. If the configuration file is modified, the service must be restarted first.
2. Log On As the root user normally.
3. Run the show variables like "% character %" command to view the system character set variables, such: