The following summarizes the installation process:
- First unzip the downloaded compressed version.
- Configure the system environment in the path variable after the extracted MySQL bin file directory
- Open the Command window with CMD, enter the mysqld --initialize command to initialize the MySQL data directory, and remember that after the initialization, a data folder is generated in the extracted directory , this folder has a. Err end file, which will have a randomly generated password when opened. Of course, you can also use the mysqld --initialize--console command, which generates random passwords that appear in a DOS window.
- Enter mysqld--install to install the MySQL service.
- Start the service with net start MySQL.
- Login and Change password mysql-u root-p password is the random password generated just now
- alter USER ' root ' @ ' localhost ' identified WITH MySQL _native_password by ' newpassword ";
< Span class= "hljs-string" > This seems to be all done, but in fact, forget one important thing, you will find that there is no My.ini file in the database installation directory,
< Span class= "hljs-string" > that the database started without the initialization parameters, this work requires us to manually create a My.ini file, the basic content is as follows:
[MySQL]; setting MySQL client default character set default-character-set =3306 ; Set the installation directory for MySQL Basedir=e:\basedb\mysql set the data storage directory of MySQL database datadir=e:\basedb\mysql\data; Allow maximum number of connections max_connections=$; 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 -storage-engine=innodb
Of course after you create this file, it is still not in effect, this is where you can first use net stop MySQL to stop MySQL and then restart.
Of course, we can also put the creation of the My.ini file in the third step above, so that the generated data directory will be located in the file configuration of the DataDir location,
mysql8.0 compressed version installed under Windows