mysql zip安装步骤 及 修改root 密码不成功问题 (Win7)

Ref:

百度搜索 mysql 安装

https://www.cnblogs.com/ayyl/p/5978418.html

http://www.runoob.com/mysql/mysql-install.html

https://blog.csdn.net/qq_39539763/article/details/79515365

https://www.cnblogs.com/gumuzi/p/5711495.html

https://www.cnblogs.com/qq78292959/p/3641972.html     方法一

 

以管理员方式运行cmd,以下均是:

I:\javasoft\mysql-5.6.24-win32\bin>cd /d I:\javasoft\mysql-5.6.24-win32\bin

I:\javasoft\mysql-5.6.24-win32\bin>mysqld --initialize-insecure --user=mysql
I:\javasoft\mysql-5.6.24-win32\bin>mysqld install

I:\javasoft\mysql-5.6.24-win32\bin>net start mysql

-------------------------------

I:\javasoft\mysql-5.6.24-win32\bin>mysql -u root

运行该命令出现错误

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

I:\javasoft\mysql-5.6.24-win32\bin>mysql -u root -p

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: Y ES)

------------------------------------------

I:\javasoft\mysql-5.6.24-win32\bin>net stop mysql

my.ini 文件增加该参数 skip-grant-tables

[mysqld]
# innodb_buffer_pool_size = 128M
# log_bin

# These are commonly set, remove the # and set as required.
 basedir=I:\javasoft\mysql-5.6.24-win32
 datadir=I:\javasoft\mysql-5.6.24-win32\data

 port=3306
# 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 

#sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 
skip-grant-tables

 

重新启动mysql 服务

I:\javasoft\mysql-5.6.24-win32\bin>net start mysql

 

I:\javasoft\mysql-5.6.24-win32\bin>mysql

mysql> show databases;

mysql> use mysql;

发现里面多出了mysql数据库

mysql> select Password from user where user='root';

mysql> update user set password=password("123456") where user="root";

mysql> select Password from user where user='root';

mysql> flush privileges;

mysql> exit;

-----------------------------------------------------------------------

密码改好后,在my.ini 文件中,remove 参数 skip-grant-tables,

再重启mysql 服务。

-------------------------------------------------------------------------

验证测试

I:\javasoft\mysql-5.6.24-win32\bin>mysql -u root -p

Enterpassword:123456

========================================

安装过程中如果出现:msvcr120.dll  丢失问题:参考

https://blog.csdn.net/wzhedward/article/details/79069179

https://www.microsoft.com/zh-CN/download/details.aspx?id=40784

下载安装即可。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值