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