Install mysql window version again, mysql-5.7.26-winx64.zip decompression version installation, detailed steps!

Table of contents

Download and unzip, create a new my.ini file

service start

Allow remote connections


Download address: https://dev.mysql.com/downloads/mysql/5.7.html#downloads

Download and unzip, create a new my.ini file

[mysqld]
# 设置3306端口
port=3306
# 设置mysql的安装目录
basedir=D:\\szw\az\mysql-5.7.26-winx64
# 设置mysql数据库的数据的存放目录
datadir=D:\\szw\az\mysql-5.7.26-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

Corresponding to your own installation path, the data file does not need to be created

cd to the bin of the lmysql installation directory to execute

mysqld --install
mysqld --initialize
//然后去data目录下找到随机密码保存待用:
//A temporary password is generated for root@localhost: 6N>&Pe_38edh
net start mysql

service start

mysql -u root -p
//输入临时密码
//修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';

Allow remote connections

use mysql;

SELECT `Host`,`User` FROM user;

UPDATE user SET `Host` = '%' WHERE `User` = 'root';

SELECT `Host`,`User` FROM user;

flush privileges;

exit;

start/stop service

net start mysql
net stop mysql

 

Guess you like

Origin blog.csdn.net/qq_44695727/article/details/105653921