Man of few words said, directly open dry
First, download the installation package
MySQL installed in two formats, one is msi format, one is zip format. If msi format, you can click installation, installed according to the installation prompts can be given, if it is their own zip format decompression, after decompression can be used, but should be configured. I am here is to use the zip format, and then confidant configuration.
Click to download the MySQL installation files
After unzipping the download is complete, extract the complete look like this:
Second, the configuration file my.ini initialization, configuration environment variable
This version of the MySQL installation files are not my.ini configuration file, you need to manually create the file, and then write the basic configuration items:
[mysqld] # Set port 3306, Port = 3306 # Set mysql installation directory basedir = D: \ MySQL data # Set mysql database storage directory DATADIR = D: \ the MySQL \ the Data
# allows the maximum number of connections max_connections = 200 is # allowed to connect the number of failures. = 10 max_connect_errors # server-side character set used by default utf8mb4 Character-the SET-Server = utf8mb4 default storage engine that will be used when creating a new table # default-Storage-Engine = INNODB # default "mysql_native_password" plug-in authentication #mysql_native_password default_authentication_plugin = mysql_native_password [mysql] # mysql client set the default character set default-character-sET = utf8mb4 [client] # set mysql client connection server default port port = 3306 default-character-sET = utf8mb4
Need to modify this configuration file is the configuration items
= basedir D: \ MySQL (MySQL directory)
= datadir D: \ MySQL \ the Data (MySQL directory \ data)
Put the file in the root directory of the installation package can be, and also important to note that the data required installation file folder, this does not need to manually create
Configuration environment variable is very simple:
My Computer -> Properties -> Advanced -> Environment Variables
Select the PATH, add it back: the path to your mysql bin folder to
MySQL initialization
During installation, you should run cmd as administrator, otherwise, the installation will complain, will lead to a failed installation
After opening into the MySQL bin directory and execute the following command in MySQL's bin directory:
mysqld --initialize --console
Note: [MY-010454] [server] generates a temporary password for the root @ localhost: 9P0gYk-? 0, kT where root @ localhost: back 9P0gYk-? 0, kT is the initial password (excluding the first space). In the absence of change passwords to remember this password, subsequent logins need to use. Copy a password saved first.
注意即使以管理员身份运行,执行这个步骤的时候也可能会报错。
原因:
之所以出现报错,是因为之前MySQL已经安装成功了,只是用Navicat或者是dos窗口连接数据库时,报”1045 access denied 。。。。“的错误
解决办法:
删除MySQL文件中data文件夹,然后按照下面的步骤继续执行
Third, install the MySQL service
If it is really like to say above error message 1045, in accordance with the following procedure to perform, how to report no 1045 error, you can run the MySQL installation services directly. Prior to the first use of MySQL service sc delete command to delete MySQL services
sc delete mysql
MySQL service after a successful delete previously installed, re-install the MySQL commands to perform the following command to install the MySQL service:
mysqld --install
When the execution command to install the MySQL service, you may be prompted , and then follow the prompts to install the computer will be able to look at this file, after a successful installation, should be able to successfully install the MySQL service
VCRUNTIME140_1.dll文件
MySQL service after a successful installation start the MySQL service by net start mysql command
Fourth, the connection MySQL, change your password
Connect to the database using a dos window executed in the MySQL bin directory
mysql -u root -p
Then enter the temporary password you just saved and then return, you should have a connection to the MySQL database and then execute
ALTER USER 'root' @ 'localhost' IDENTIFIED BY 'new password';
After a successful change password
exit;
Finally, download a database connection Navicat visualization tools, landing, using just change the password after a successful
Select the PATH, add it back: the path to your mysql bin folder