MySQL5.7.25解压版安装教程
1.下载对应的zip包
2.选择合适的安装路径,并记录解压的路径 本人的是 D:\MySQL\mysql-5.7.25-winx64
3.配置环境变量,添加变量名path,并在下方的变量值框中输入mysql bin根路径 我的是 D:\MySQL\mysql-5.7.25-winx64in
4.新建my.ini文件,并放在mysql根目录(我的是D:\MySQL\mysql-5.7.25-winx64\mysql-5.7.25-winx64) 注意路径用\而不是
配置系统环境:打开环境变量设置,在用户变量(系统变量)新建MYSQL_HOME变量,值为D:MySQLmysql-5.7.25-winx64在用户环境变量(系统变量)新建Path变量,组、值为%MYSQL_HOME%in即可;
[mysqld]port = 3306
basedir=D:\MySQL\mysql-5.7.25-winx64
datadir=D:\MySQL\mysql-5.7.25-winx64\data
max_connections=200
character-set-server=utf8
default-storage-engine=INNODB
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysql]
default-character-set=utf8
[WindowsMySQLServer]
Server=D:\MySQL\mysql-5.7.25-winx64\bin\mysqld.exe
在 mysql 安装目录执行,初始化数据库(data 目录下,会初始化文件,如果已经存在会报错,可以将data 目录清空再执行)
D:MySQLmysql-5.7.25-winx64> mysqld --initialize-insecure --user=mysql
D:MySQLmysql-5.7.25-winx64in>cd ..D:MySQLmysql-5.7.25-winx64> mysqld --initialize-insecure --user=mysql
2020-03-29T03:42:19.917292Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-03-29T03:42:19.917362Z 0 [Warning] "NO_ZERO_DATE", "NO_ZERO_IN_DATE" and "ERROR_FOR_DIVISION_BY_ZERO" sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2020-03-29T03:42:19.917367Z 0 [Warning] "NO_AUTO_CREATE_USER" sql mode was not set.
2020-03-29T03:42:19.919817Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2020-03-29T03:42:19.920362Z 0 [ERROR] Aborting
D:MySQLmysql-5.7.25-winx64> mysqld --initialize-insecure --user=mysql
D:MySQLmysql-5.7.25-winx64>cd bin
D:MySQLmysql-5.7.25-winx64in>mysqld -install
Service successfully installed.
D:MySQLmysql-5.7.25-winx64in> net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。
D:MySQLmysql-5.7.25-winx64in>
5.然后执行 mysqld --initialize-insecure --user=mysql 命令
6.并以管理员身份运行cmd在(D: oolsmysqlmysql-5.7.25-winx64in)
然后 执行 mysqld -install 命令
7.继续在bin文件夹下执行 net start mysql 启动mysql
8.net stop mysql关闭mysql,
然后执行命令 mysqld --defaults-file="E: oolsmysqlmysql-5.6.32-winx64my.ini" --skip-grant-tables
9.打开新的cmd在bin这个文件夹下 然后执行命令 mysql -uroot -p ,然后依次进行以下命令:
(1)use mysql;
(2)update user set authentication_string=password("新密码") where user="root" and Host="localhost";
(3)刷新权限:flush privileges;
(4)退出:quit
(5)重新登录:mysql -uroot -p 提示输入密码,这时输入密码会提示欢迎进入...
至此 配置完成!
如果安装提示
mysql msvcr120
报错,需要安装
(VC2013下载64位+32位)解决mysql5.7 报错问题
https://download.csdn.net/download/gaibianziji23/10715642
电脑装MySQL免安装版配置失败提示系统错误2怎么解决?
找到my-default.ini文件,并进行编辑并保存:# basedir = .....
# datadir = .....
找到这两行,复制到[mysqld]的下一行,然后去掉签名的#并修改后面的路径,如:
basedir = d:/dev/mysql (免安装包的位置,要根据具体情况填写)
datadir = d:/dev/mysql/data (数据库文件的位置)
然后在下一行加上以下内容:
[WindowsMySQLServer]
Server=d:/dev/mysql/bin/mysqld.exe
以上是 MySQL5.7.25解压版安装教程 的全部内容, 来源链接: utcz.com/z/532871.html