One, download the zip version of the free install version of MySQL, and unzip the installation directory below
Second, add the MySQL bin directory to the Windows path, making it possible to access commands such as MySQL.
* Encountered a strange problem, in Win10 's path added MySQL running record. But the execution of MySQL is still not found. At this point, the bin directory for MySQL is the last entry in path. Then add another entry in path (for example, path is ...; %mysql_bin%;D: \test;) You can find MYSQL in the command
Third, create the MySQL boot options file My.ini.
MySQL will search for my.ini configuration files from multiple directories such as C:, windir, installation directory , and so on. The mysql5.7.1.17 does not have a startup configuration file, and the Data folder is not set. The data directory can be created in the installation directory or where you want to store
Create the My.ini file and set the configuration as follows
[Client]
#客户端使用UTF8
Default-character-set=utf8
[Mysqld]
#服务启动的目录
#注意Windows下面, the directory path delimiter to use/, if you want to use a backslash, then \ \
Basedir=d:/server/mysql-5.7.18-winx64
Datadir=d:/server/mysql-5.7.18-winx64/data
Port = 3306
#服务器默认使用UTF8
Character-set-server=utf8
#不使用授权表可以登陆MYSQL, for initial launch
Skip-grant-tables
Four, call Initialize command, initialize. This command needs to be run with administrator privileges.
Win10 the Start Menu window icon Right-click Command Prompt (Administrator) to open
Mysqld--initialize
\mysqld--initialize-insecure #这个命令, after initialization, the root user is a blank password
* * You can also make configuration files that are used during initialization
Mysqld--defaults-file=c:\my.ini--initialize
After executing the command, MySQL will initialize the data storage directory and some initialization of the database's original table, including the creation of the root user.
In the Xxxxxx.err file below the Data directory directory, you can view the random password of the generated root
Five. Start the MySQL service
Mysqld--console
Five, login and change the password
If you forget your password, you can find the initialized random password from the MySQL error log.
ALTER USER ' root ' @ ' localhost ' identified by ' Abcd8888 ';
This article is from the "11395639" blog, please be sure to keep this source http://11405639.blog.51cto.com/11395639/1922589
Windows configuration startup surface installation version MySQL