windows10 install the database mysql-5.7.26-winx64 Detailed, free installation

First we went to the official website to download MySQL-5.7.26-Winx64 (click to enter the official website) we will see the following pages, will be asked to register or log in, but do not want to log in, then we click on the bottom, not thanks, just start my download

 

Unzip the downloaded file to the directory you want to store, open the folder you will see the following directory structure, data directory remember the red box you can not see

Configuration environment variable, right-click on the left "" This Computer "" Properties "" Advanced System Settings "" environment variable "" click on the red box, the new, the files on your bin directory to environment variable, as is my file directory structure, click "" OK

Now configured the environment variables

We created it in the directory my.ini create my.txt then rename the file extension to modify it to create the ini file, as shown in the red box, use Notepad to open

And then copy it into a document, you can modify directory

[client]
port=3306
default-character-set=utf8
[mysqld]
# 设置服务器的访问端口和字符集
port=3306
character_set_server=utf8
# 允许最大连接数
max_connections=20
# 设置为自己MYSQL的安装目录
basedir=D:\mysql\mysql-5.7.26-winx64
# 设置为MYSQL的数据目录
datadir=D:\mysql\mysql-5.7.26-winx64\data
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB

We open the cmd command line, cd into the file under the bin directory, execute mysqld --initialize-insecure, a little later on, then you will see there are other materials when it comes to the data file, which is the first figure the red box content, which is executed mysqld --install installation services in the bin directory.

As shown above, you can now start the database,

Start the database

net start mysql

Stop the database

net start mysql

Access to the database,

 

mysql -u root -p password new

Because I did not initialize password, you can use directly enter the mysql.

If you do not set a password initialization, of course, we can change the password

 Use mysqladmin command

 myslqadmin -u root -p password 182

If so afraid that they forget to set a password when you first do their own learning

 Press Enter, because no password, so you can directly enter (if so, enter the original password)
 

 

Guess you like

Origin blog.csdn.net/weixin_42236288/article/details/94714109