当前位置:网站首页>mysql5.7解压版配置步骤
mysql5.7解压版配置步骤
2022-07-22 09:24:00 【小白说(๑• . •๑)】
文章目录
之前使用的都是mysql5.5的版本,今天突然因为一些原因需要使用到更高版本的数据库。这个安装过程整得我好痛苦,以前安装mysql5.5的时候双击.msi文件傻瓜式安装就OK,但是我安装mysql5.7的时候出现各种错误,后来转道配置免安装版本的mysql5.7了。
安装环境
windows10+mysql5.7
下载mysql5.7
解压到E盘下(也可以是其他盘)
配置环境变量
在我的电脑——属性——高级系统设置——环境变量–>找到path,添加
配置my.ini(重要的来了)
有些免安装的mysql里面有自带的默认配置文件my-default.ini不过没有也没得关系,自己创建一个my.ini文件在安装目录下面,内容为:
[mysql]
#设置mysql客户端默认字符集
default-character-set=utf8 #utf8mb4
[mysqld]
#安装目录
#表示mysql安装路径
basedir=E:\mysql-5.7.22-winx64\
#表示mysql数据文件存储路径
datadir=E:\mysql-5.7.22-winx64\data\
#表示mysql端口
port=3306
# 允许最大连接数
max_connections=200
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8 #utf8mb4
#character-set-client-handshake = FALSE
#collation-server = utf8mb4_unicode_ci
#init_connect='SET NAMES utf8mb4'
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
#报错invalid default value for ‘XXX’ 是因为默认格式错误或其他,添加此行可以不报错误
sql_mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
#表示忽略密码,跳过密码检测
skip-grant-tables
在执行下面操作的时候,一定要配置好my.ini文件。
安装mysql
以管理员的身份打开CMD窗口,进入到mysql的bin目录下
执行安装
mysqld --install
因为我已经安装过了,所以就不在运行了,安装好之后会有提示。
初始化数据文件
mysqld --initialize-insecure --user=mysql
没有初始化数据就启动服务,会报错的哦!
启动服务
net start mysql
登陆mysql
mysql –u root –p //回车,提示输入密码,直接回车就可以,因为在前面的ini配置文件中已经跳过了密码检测。(此处的root是在安装mysql的时候默认创建的用户)
修改密码
update mysql.user set authentication_string=password(‘你修改的密码’) where user=‘root’ and Host = ‘localhost’;
刷新权限
flush privileges
修改配置文件
注释掉,或者是删除skip-grant-tables
重启服务
关闭服务,在重新开启
net stop mysql
net start mysql
参考链接:
https://www.cnblogs.com/allbetter/p/8686518.html
https://www.cnblogs.com/kawhileonardfans/p/10966818.html
https://blog.csdn.net/eagle89/article/details/85159173
边栏推荐
- JVM-系统优化
- How to resolve errors in executing the yum makecache command
- Problems encountered in using openfeign to realize remote call in Webflux
- C语言 static和extern知识点
- Latex如何写引用时将作者名字缩写为et al
- Strncpy() copy string (limited by length)
- [QT source code reuse] simulate the pop-up mode of qcompleter
- JVM system optimization
- Interrogation aléatoire de n données dans diverses bases de données
- Transformer再下一城!low-level多个任务榜首被占领,北大华为等联合提出预训练模型IPT
猜你喜欢
MNIST手写数字识别案例TensorFlow 2.0 实践
Six dimensional space
二、IDEA搭建JFinal項目+代碼自動生成+數據庫操作測試(三種方式)
Programmer interview golden code interview question 01.03. URL
Kindling the Darkness: A Practical Low-light Image Enhancer
在各類數據庫中隨機查詢n條數據
15 SQL optimizations commonly used by experts
OSI七层网络模型
Loss function in logistic regression
1. The solution of line feed qt5- "vs" in constants; 2. Problems and solutions of common compilation of QT and vs of the same code
随机推荐
Parameter index out of range (1 > number of parameters, which is 0).
Flink learning notes (V) datastream API
Summary of all usage of join in SQL syntax (simple example)
Flink学习笔记(六)Flink的时间和窗口
paper - A Physics-based Noise Formation Model for Extreme Low-light Raw Denoising
【滑动窗口技巧】76. 最小覆盖子串
程序员面试金典面试题 01.05. 一次编辑
6-2-depth first search underground maze exploration (30 points)
Pat basic problem set 7-26 word length (simplified code)
QT | modal dialog and modeless dialog qdialog
PTA basic questions 7-28 monkeys choose the king (simple method)
There is no session in the tensorflow module
Flink学习笔记(三)Flink安装部署
Leetcode 105. constructing binary trees from preorder and inorder traversal sequences
How to resolve errors in executing the yum makecache command
Three ways to restrict IP access between micro services
MNIST手写数字识别案例TensorFlow 2.0 实践
程序员面试金典面试题 01.01. 判定字符是否唯一
Log4j log configuration details
Exercise 7-4 find out the elements that are not common to two arrays (C language)