测试员的那点事

win7 mysql安装详解及报错解决

2020-11-28  本文已影响0人  望月成三人

mysql准备

my.ini内容:

[mysqld]
[mysqld]
# 设置3306端口
port=3306
# 设置mysql的安装目录
basedir=E:\\app\\mysql-8.0.22-winx64
# 设置mysql数据库的数据的存放目录
datadir=E:\\app\\mysql-8.0.22-winx64\\data
# 允许最大连接数
max_connections=200
# 允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统
max_connect_errors=10
# 服务端使用的字符集默认为UTF8
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8
[client]
# 设置mysql客户端连接服务端时默认使用的端口
port=3306
default-character-set=utf8

mysql安装

@echo 开始注册
copy vcruntime140_1.dll %windir%\system32\
regsvr32 %windir%\system32\vcruntime140_1.dll /s
@echo system32 vcruntime140_1.dll注册成功

copy vcruntime140_1.dll %windir%\SysWOW64\
regsvr32 %windir%\system32\vcruntime140_1.dll /s
@echo SysWOW64 vcruntime140_1.dll注册成功
@pause
E:\>mysqld --initialize --user=mysql --console
2020-11-28T03:32:30.871296Z 0 [System] [MY-013169] [Server] E:\app\mysql-8.0.22-
winx64\bin\mysqld.exe (mysqld 8.0.22) initializing of server in progress as proc
ess 6964
2020-11-28T03:32:30.873294Z 0 [Warning] [MY-013242] [Server] --character-set-ser
ver: 'utf8' is currently an alias for the character set UTF8MB3, but will be an
alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to
 be unambiguous.
2020-11-28T03:32:30.884295Z 1 [System] [MY-013576] [InnoDB] InnoDB initializatio
n has started.
2020-11-28T03:32:33.331435Z 1 [System] [MY-013577] [InnoDB] InnoDB initializatio
n has ended.
2020-11-28T03:32:35.760574Z 6 [Note] [MY-010454] [Server] A temporary password i
s generated for root@localhost: JoyfjqHL5)SO

E:\>mysqld install
Service successfully installed.
E:\>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功
E:\>mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';

mysql连接

上一篇下一篇

猜你喜欢

热点阅读