当前位置:网站首页>MySQL开发环境
MySQL开发环境
2022-06-26 02:49:00 【時宜】
目录
一、解压安装包
从官方网站下载MySQL安装包 将安装包解压到指定目录
二、配置环境变量
新建MYSQL_HOME C:\Program Files\mysql\mysql-5.7.23-winx64(根据自己定义的目录填写)
编辑path %MYSQL_HOME%\bin
点击此电脑==》右键属性==》找到高级系统设置==>环境变量 然后根据上方提示完成
三、新建my.ini
这里给大家提供了my.ini的内容 将新建的my.ini放到C:\Program Files\mysql\mysql-5.7.23-winx64文件夹下
[mysqld]
port = 3306# 设置mysql的安装目录
basedir=C:/Program Files/mysql/mysql-5.7.23-winx64# 设置mysql数据库的数据的存放目录
datadir=C:/Program Files/mysql/mysql-5.7.23-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
说明:
sql_mode
NO_ENGINE_SUBSTITUTION:mysql 在create table 时可以指定engine子句
STRICT_TRANS_TABLES:对于单个insert操作,无论插入单行或是多行,只要插入数据与字段类型不兼容,则insert操作失败并回滚
与mysql最接近的是mariadb
四、安装MySQL服务
以管理员的身份运行cmd(搜索cmd右键)

打开文件所在的bin目录

- 输入安装命令:mysqld -install

- 初始化 mysqld --initialize-insecure --user=mysql
根据刚刚my.ini文件去初始化,然后会产生一个data文件夹
- 启动 net start mysql
- 设置密码 mysqladmin -u root -p 123456 新密码
Enter password: 旧密码 直接回车,因为初始化直接把mysql的密码设置为空
若mysql输入正确密码无法登陆,出现ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password:yes) 该怎么办
(这里cmd界面就不进行展示了 如果想看详情可以去看下方展现的链接的博客mysql输入正确密码无法登陆,出现ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password:yes))
第一步:关闭mysql服务 net stop mysql
第二步:输入命令
mysqld --defaults-file=“D:\softwareinstall\Mysqlinstall\MySQL Server 5.5\my.ini” --console --skip-grant-tables注:填了背景的内容是ini路径不要写错了
第三步:另外启动一个命令行窗口,输入命令: mysql -uroot -p 回车然后输入之前无法登录那个正确的密码
第四步:输入命令: use mysql;(分号不要丢)
第五步:(5.7.11以前)输入命令update user set password=password(“123456”) where user=“root”;
(5.7.1或者以后)输入update user set authentication_string=password(“123456”) where user=“root”;(分号不要丢)
- 连接 mysql -uroot -p

- 显示数据库 show databases;

五、解决mysql不能远程连接的问题
1. 在mysql服务器上进入 mysql的命令行
2. 执行如下语句: (注意密码需要根据自己的配置修改)
mysql> grant all privileges on *.* to [email protected]'%' identified by '123456';
mysql> flush privileges;
六、卸载MySQL
1 停止服务 net stop mysql
2.删除服务 sc delete mysql 但是服务只是禁用状态,服务还是存在
3.移除服务 mysqld remove 需要进入bin目录,在服务中已经找不到mysql服务了
4.删除注册表信息
1)HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\MySQL2)HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\MySQL
3)HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MySQL
5.删除mysql的安装目录
打开注册表 regedit
打开服务 services.msc
注意1:有保护关闭,特别是自我保护要关闭,不然没法卸载
注意2:权限问题
边栏推荐
- 工业机器人之“慧眼”——机器视觉
- How to adjust face input size
- ArrayList # sublist these four holes, you get caught accidentally
- 附加:HikariCP连接池简述;(并没有深究,只是对HikariCP连接池有个基本认识)
- Translation notes of orb-slam series papers
- Scratch returns 400
- How to add a regression equation to a plot in R
- 如何提词条
- 2021-08-04
- 论文回顾:Unmixing-Based Soft Color Segmentation for Image Manipulation
猜你喜欢

OpenAPI 3.0 specification - Food Guide

Camtasia 2022 nouvelle vidéo d'ordinateur d'enregistrement ultra - clair

Inkscape如何将png图片转换为svg图片并且不失真

Cultivate children's creativity under the concept of project steam Education

数字孪生智慧水务,突破海绵城市发展困境

少儿编程对国内传统学科的推进作用

Vulhub replicate an ActiveMQ

【论文笔记】Manufacturing Control in Job Shop Environments with Reinforcement Learning

经典模型——AlexNet

【读点论文】FBNetV3: Joint Architecture-Recipe Search using Predictor Pretraining 网络结构和超参数全当训练参数给训练了
随机推荐
附加:HikariCP连接池简述;(并没有深究,只是对HikariCP连接池有个基本认识)
[QT] custom control - air quality dashboard
Install development cross process communication
解析少儿编程的多元评价体系
How to add a table to a drawing in ggplot2
浅谈虚拟内存与项目开发中的OOM问题
计组笔记——CPU的指令流水
[QT] custom control - switch
Butterknife unbinder uses flashback in fragment and viewpager
用元分析法驱动教育机器人的发展
Qt编译出错ERROR: Unknown module(s) in QT: script
MySQL增删查改(初阶)
Is it safe to open an online stock account?
The golang regular regexp package uses -06- other usages (special character conversion, finding the regular common prefix, switching greedy mode, querying the number of regular groups, querying the na
经典模型——AlexNet
arduino字符串转16进制数 大彩串口屏用。
学习太极创客 — MQTT(四)服务端连接操作
【解决】CMake was unable to find a build program corresponding to “Unix Makefiles“.
Dreamcamera2 video recording, playing without sound, recording function is normal, using a third-party application for video recording, playing with sound
Google recommends using kotlin flow in MVVM architecture
https://www.mysql.com/