mysql安装 root account password_mysql 配置 安装和 root password 更改

第一步:

修改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 ifyou

#***upgrade to a newer version of MySQL.

[mysqld]

# Remove leading # andset to the amount of RAM forthe most important data

# cachein MySQL. Start at 70% of total RAM for dedicated server, else 10%.

# 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 commonlyset, remove the # and set asrequired.

# basedir=.....

# datadir=.....

# port=.....

# server_id=.....

# Remove leading # toset options mainly useful forreporting servers.

# The server defaults are fasterfortransactions and fast SELECTs.

# Adjust sizesasneeded, experiment to find the optimal values.

# join_buffer_size=128M

# sort_buffer_size=2M

# read_rnd_buffer_size=2M

#########################################################

[client]

port=3306

default-character-set=utf8

[mysqld]

skip_grant_tables

port=3306character_set_server=utf8

basedir=E:\mysql-5.7.17-winx64

#解压目录

datadir=E:\mysql-5.7.17-winx64\data

#解压目录下data目录

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

[WinMySQLAdmin]

E:\mysql-5.7.17-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 文件夹删除  重新初始化 启动一下

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值