Mysql installation and configuration

Source: Internet
Author: User

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:

 

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.