MySQL 8.0 configuration summary for Windows10

  • Because Oracle server is not domestic reasons, many users (including myself small series) appears after installation exe file with a bad situation, we now refer to other, Xiao Bian also put together a program.

    download

In MySQL official website to download, Downlads-> Community-> MysSQL Community Server
to choose their own system of mysql

installation:

First, there is the Chinese system is not recommended user name, because any software will go C:/users/your admin(用户名)/AppDatedown to produce some cache files.
1. Download the zip decompressed into the appropriate place, the present embodiment into the disc D.

2. Configure environment variables:

This Computer -> Right Properties -> Advanced System Settings -> Environment Variables -> Path-> Edit -> New Fill bin directory path -> OK.

3. Configure initialization my.ini

Root directory created my.ini file

Wrote the following in my.ini in! ! ! The fourth line needs to be modified, write your own installation directory, the sixth line empathy.

[mysqld]

# 设置3306端口
port=3306
# 设置mysql的安装目录
basedir=D:\mysql-8.0.18-winx64   # 有些电脑需要用双斜线\\
# 设置mysql数据库的数据的存放目录
datadir=D:\mysql-8.0.18-winx64\Data   # 此处同上
# 允许最大连接数
max_connections=200
# 允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统
max_connect_errors=10
# 服务端使用的字符集默认为UTF8
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
# 默认使用“mysql_native_password”插件认证
default_authentication_plugin=mysql_native_password
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8
[client]
# 设置mysql客户端连接服务端时默认使用的端口
port=3306
default-character-set=utf8
4. Initialize the database

Open the administrator cmd, enter the mysql bin directory, enter the code below:

mysqld --initialize --console
! ! ! After the successful operation, write down the password is generated for root @ localhost: behind the initial password.
5. Install the MySQL service

Also in the bin path cmd, enter the following code:

mysqld --install
6.MySQL service-related operations

Start MySQL:

net start mysql

Stop MySQL:

net stop mysql

Change Password:
to enter into mysql, enter the following code, then enter the password Enter

mysql -u root -p

Then enter the following code, the present embodiment change the password 123456

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';

References (major): https://www.jianshu.com/p/df774ce286b8

Guess you like

Origin www.cnblogs.com/MrLiu199903/p/12178753.html