mysql 配置 安装和 root password 更改
2024-08-29 16:31:28
第一步:
修改my.ini文件,替换为以下内容 (skip_grant_tables***重点)
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html # *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL. [mysqld] # Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at % of total RAM for dedicated server, else %.
# innodb_buffer_pool_size = 128M # Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin # These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = ..... # Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M #########################################################
[client]
port=
default-character-set=utf8
[mysqld]
skip_grant_tables
port=
character_set_server=utf8
basedir=E:\mysql-5.7.-winx64
#解压目录
datadir=E:\mysql-5.7.-winx64\data
#解压目录下data目录
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[WinMySQLAdmin]
E:\mysql-5.7.-winx64\bin\mysqld.exe
########
第二步:
进入到MySQL的安装目录,按 shift+(鼠标右键) 点击命令行窗口 使用mysqld --initialize 进行初始化 (会在安装目录下创建一个data文件夹)
第三步:
在安装目录文件夹下 进入命令行模式 shift+(鼠标右键) 使用 net start mysql 启动服务
使用 mysql -uroot -p无密码登录
进入之后
mysql> use mysql;
mysql> update user set authentication_string=password("123") where user="root";(别忘了最后加分号)
mysql>flush privileges;
mysql>quit;
第四步:
进入my.ini文件将skip_grant_tables注释
重新进入命令行
net stop mysql
net start mysql (重新启动服务)
mysql -uroot -p
(使用更改后的密码登录)
succeed;
************************************************************************************************************************
最后温馨提示:如果net start mysql 提示无法启动服务,且没有提示错误 可以将 data 文件夹删除 重新初始化 启动一下
最新文章
- Java面试查漏补缺
- 转载文章-----Rational Rose2007(v7.0)下载地址、安装及激活详解教程(图)
- SYN Flood应如何应对
- PMP 第六章 项目时间管理
- ios网络学习------6 json格式数据的请求处理
- 在Jena框架下基于MySQL数据库实现本体的存取操作
- POJ 2159 Ancient Cipher
- DELPHI 数学函数+字符处理函数
- 九度OJ 1077 最大序列和 -- 动态规划
- 把内表 itab1 的 n1 到 n2 行内容附加到 itab2 内表中去.
- C\C++代码优化的27个建议
- Linux0.11 创建进程的过程分析--fork函数的使用
- Fiddle Proxy
- ReactNative学习笔记(六)集成视频播放
- Alpha冲刺! Day7 - 砍柴
- TStack与IBM LinuxONE通过兼容性认证
- 教你使用SQL数据库复制系列(1-7)
- 常见的浏览器端的存储技术:cookie
- python learning2.py
- CodeForces - 1016C Vasya And The Mushrooms