win10 mysql 8.0. 11 Compressed Version Installation Detailed Tutorial

  • 2021-10-25 08:09:00
  • OfStack

After reinstalling the computer recently, I downloaded the decompressed version of mysql 8.0. 11 based on the obsessive-compulsive disorder principle of only installing the latest version.

But on the Internet to find a variety of installation tutorials 5 flowers 8 doors, no one can be installed successfully, is really drunk, here I write down my own successful installation method to share with you.

1. Configuration of environment variables

First download the latest mysql8.0. 11 database in official website, unzip it to the drive letter you need to place, and then create a new MYSQL_HOME

Parameter is mysql. The bin file path of the unzipped installation file is as follows:

Variable name: MYSQL_HOME

Variable value: E:\ tools\ database\ mysql\ mysql8.0. 11\ mysql-8. 0.11-winx64\ bin

Then add% MYSQL_HOME% at the beginning of the Path variable; Then confirm to save;

2. Configure the my. ini file


[mysqld]
#  Settings 3306 Port 
port=3306
#  Settings mysql Installation directory of 
basedir=E:\\tools\\database\\mysql\\mysql8.0.11\\mysql-8.0.11-winx64
#  Settings mysql The storage directory of the data in the database 
datadir=E:\\tools\\database\\mysql\\mysql8.0.11\\data
#  Maximum number of connections allowed 
max_connections=200
#  The number of connection failures allowed. This is to prevent an attempt to attack the database system from this host 
max_connect_errors=10
#  The character set used by the server defaults to utf8mb4
character-set-server=utf8mb4
# Use skip-external-locking MySQL Option to avoid external locking. This option is turned on by default 
external-locking = FALSE
#  Default storage engine to be used when creating new tables 
default-storage-engine=INNODB 
#  Default uses " mysql_native_password "Plug-in authentication 
default_authentication_plugin=mysql_native_password

[mysqld_safe]
log-error=E:\\tools\\database\\mysql\\mysql8.0.11\\mysql_oldboy.err
pid-file=E:\\tools\\database\\mysql\\mysql8.0.11\\mysqld.pid
#  Definition mysql What should be supported sql Syntax, data verification 
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysql]
#  Settings mysql Client default character set 
default-character-set=utf8mb4
[client]
#  Settings mysql The default port used when the client connects to the server 
port=3306
default-character-set=utf8mb4

In the mysql directory to create a new my. txt file, and I can set up a sample, can also see the official document configuration.

What needs to be explained in the configuration here is:

basedir: Installation directory for mysql

datadir: For the database data storage location, pay attention to modify according to their own 1

log-error: You also need to set it according to your own file directory

pid-file: Sample 1 is set according to its own file directory

It should also be noted that the file path is no longer a single "\" as in 5. x version 1, but "\\"

Save after configuration and modify the suffix to my. ini

One more note: Although you wrote data on the path, you must not create this file yourself, otherwise mysql will report that data already exists and cannot be initialized

3. Initialize the database

At this time, open cmd and start it as an administrator

1. Type the command drive letter: such as my e:

2. cd E:\ tools\ database\ mysql\ mysql8.0. 11\ mysql-8. 0.11-winx64\ bin

3. Enter the command mysqld-initialize-user=mysql-console to initialize the database. When waiting for 1, an initial password will appear, which must be copied and pasted into a document

4. Wait 1 will prompt you for successful initialization, and then execute mysqld-install will prompt you for successful installation

4. Modify the initial password of root account

Run cmd input:


net start mysql

Enter after mysql is started:


mysql - u root -p

You will be prompted to enter the password, the initial password you saved is used here, and you will be prompted to welcome after entering it. Modify the initial password below


ALTER USER 'root'@'localhost' IDENTIFIED BY ' New password ';

Remember that the statement with ';' will prompt success, and then enter


FLUSH PRIVILEGES;

To refresh the database users, to this installation is finished, you can try to create a new table and then query a piece of data, is really faster than 5. x oh


Related articles: