多语言展示
当前在线:523今日阅读:2今日分享:31

windows7安装mysql-5.7.25-winx64

windows7安装mysql-5.7.25-winx64。1、解决编码不正确报错问题。2、解决password不存在问题。
工具/原料

浏览器

方法/步骤
1

下载mysql5.7.路径:https://dev.mysql.com/downloads/mysql/5.7.html#downloads

3

在解压目录中新建data文件夹和my.ini文件。注意:保存my.ini的时候一定要保存为ANSI格式文件。用记事本打开my.ini,填充以下内容:[mysql]#设置mysql客户端默认字符集default-character-set=utf8[mysqld]#设置3306端口port=3306#设置mysql的安装目录basedir=E:\mysql-5.7.25#设置mysql数据库的数据的存放目录datadir=E:\mysql-5.7.25\data#允许最大连接数max_connections=200# 服务端使用的字符集默认为8比特编码的latin1字符集character-set-server=utf8#创建新表时将使用的默认存储引擎default-storage-engine=INNODB

4

按win+R键,输入cmd,打开dos命令窗口, 输入:mysqld --initialize,回车。

5

初始化完成以后,输入:mysqld install MySQL --defaults-file='E:\mysql-5.7.25\my.ini',回车。

6

安装完成,输入命令 net start mysql,启动mysql服务。

7

服务启动正确以后,在dos窗口中输入:“mysql -uroot -p”回车。问题一:会提示密码不正确。我们来修改密码:参考:https://www.cnblogs.com/wxdblog/p/6864475.html

8

执行下面语句会报错:password不存在update user set password=password('new_pass') where user='root';修改为:update user set authentication_string=password('new_pass') where user='root' and host='localhost';

注意事项
1

my.ini文件编码错误会报错:Found option without preceding group in config file。

2

my.ini文件保存为ANSI格式文件.

3

password字段改成了authentication_string

推荐信息