Install and configure MySQL (5.6.20) under Windows

Source: Internet
Author: User
Tags change settings dedicated server

Original address: http://www.cnblogs.com/qiyebao/p/3887055.html

1. First go to http://dev.mysql.com/. Download the Windows edition mysql5.6 free install ZIP package. Then extract the zip package to D:\mysql-5.6.20-winx64.

2. Copy the My-default.ini under MySQL and create the My.ini in the same directory. My.ini is the configuration for MySQL. The simplest configuration:

1 basedir=d:/mysql-5.6.20-winx64

2 datadir=d:/mysql-5.6.20-winx64/data

My configuration is:

1 # for advice the change settings

2 # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html

3 # * * * does not EDIT this FILE. It' s a template which 'll be copied to the

4 # * * * * default location during install, and would be replaced if You

5 # * * * Upgrade to a newer version of MySQL.

6

7 [mysqld]

8 character-set-server=utf8

9

Ten # Remove leading # and set to the amount of RAM for the most Important data

# Cache in MySQL. Start at +% of total RAM for dedicated server, elseten.

# innodb_buffer_pool_size = 128M

13

# Remove Leading # to turn on a very important data integrity Option:logging

# Changes to the binary log between backups.

# Log_bin

17

These is commonly set, remove the # and set as required.

# Basedir = .....

# DataDir = ...

# port = ... ..

# server_id = ...

basedir=d:/mysql-5.6. -winx64

datadir=d:/mysql-5.6. -winx64/data

port=13306

26

character-Set-server=utf8

default-storage-engine=innodb

innodb_data_home_dir=d:/mysql-5.6. -winx64/data

Innodb_data_file_path=ibdata1:12m:autoextend

innodb_log_group_home_dir=d:/mysql-5.6. -winx64/data

32

innodb_buffer_pool_size=10240m

innodb_log_file_size=4g

# Remove Leading # to set options mainly useful for reporting servers.

The server defaults is faster for transactions and fast selects.

Notoginseng # Adjust sizes as needed, experiment to find the optimal values.

# join_buffer_size = 128M

# sort_buffer_size = 2M

# read_rnd_buffer_size = 2M

41

# Sql_mode=no_engine_substitution,strict_trans_tables

3. Set the environment variable path. Add D:\mysql-5.6.20-winx64\bin to path.

4.CMD below try to start mysqld--console, and the background log output on the screen.

5. Register MySQL for Windows service. You can later use Windows service to install Mysqld and uninstall MYSQLD services.

Install the MySQL service, enter the D:\mysql-5.6.20-winx64\bin directory to perform the installation

Mysqld Install

Uninstalling the MySQL service

Mysqld Remove

6. Go to Service Manager

7. Start the MySQL service

8.net start MySQL start MySQL service, net stop MySQL stop MySQL service

9. You can also turn off the MySQL service using the mysqladmin command.

10. Log in to the MySQL database with the root user ( password return is OK )

If the MySQL connection port is not the default 3306, you can use the following command

Mysql-p13306-u root-p

Specify MySQL connection port 13306

If the MySQL connection server IP is not native or the user name does not support native login, you can use the following command

??

MYSQL-H machine name or IP address-p13306-u root-p

??

11. Show all databases

show databases;

12. Change the login password of the root account 1234:

GRANT all on * * to ' root '@' localhost ' identified by ' 1234 ';

13. Create a database to specify the Chinese encoding method

14. View MySQL Storage engine

Show engines;

15. Create MySQL remote connection user, set maximum permissions and login password.

GRANT all on * * to ' sa '@'% ' identified by ' 1234 ' with GRANT OPTION;

There are also some commands for testing MySQL installation:

Finally, set the command to open the deadlock switch:

Setglobal innodb_print_all_deadlocks=on

To see if the switch is already open:

Show variables like ' innodb_print_all_deadlocks '

(go) Install and configure MySQL under Windows (5.6.20)

Related Article

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.