Windows install MySQL

Source: Internet
Author: User

Windows install MySQL

1. Download the MySQL Zip installation package and extract it to the directory you want to install, assuming the extracted directory is P:\mysql
Unpacked Directory: Bin
Docs
Include
Lib
Share
COPYING
My-default.ini
Readme
Note: There is no data folder at this time (storage directory for MySQL database)

2. In P:\mysql new My.ini file for database configuration (P is my own drive letter, MySQL is the new folder under the P-disk, my system is 64-bit)
Content in the My.ini file:
# set up the MySQL installation directory
Basedir = P:\mysql\mysql-5.7.10-winx64
# Set up a storage directory for MySQL database data
DataDir = P:\mysql\mysql-5.7.10-winx64\data
# Set 3306 port
Port = 3306
# server_id = ...
# Maximum number of connections allowed
max_connections=200
# The character set used by the service side defaults to the 8-bit encoded latin1 character set
Character-set-server=utf8
# The default storage engine that will be used when creating a new table
Default-storage-engine=innodb

3. Shortcut key win+r run cmd command, enter the DOC command interface (Access with administrator privileges)
Switch directories to P:\mysql\bin in the terminal
Enter $ mysqld Install

Complete the installation.


Enter $ mysql--initialize-insecure

Create the data directory and the root user without a password
(It is critical that the database service cannot be started if the content in the data directory is wrong)
(There is also a command that is $ mysql--initialize this generated root password is random)

($mysql--console can see the database startup error message)

4. Start the MySQL service
$ net start MySQL

You can now log in to the database with the command $ mysql-uroot-p

Windows install MySQL

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.