mysql-5.7.17-winx64 win10 安装指南 和 修改root 密码
2017-03-13 19:38
806 查看
(也许有很多人跟我遇过到同样的问题)
======================================================================================
首先,我是照着这个链接安装的: http://blog.csdn.net/rebirth_love/article/details/53608483 数据库可以安装成功,但是服务不能启动。
其中评论区有提到,要在第四步执行mysqld --initialize --user=mysql --console 初始化
但是按照他这样做还是不成功,我是装在D盘,D:\mysql-5.7.17-winx64\
首先,如果你不是在D:\mysql-5.7.17-winx64\bin
比如你在cmd 默认目录下执行mysqld --initialize --user=mysql --console ,则会提示: [ERROR]
Can't find error-message file 'C:\WINDOWS\system32\%MYSQL_HOME%\share\errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
所以是目录不对,要切到D:\mysql-5.7.17-winx64\bin 目录,但是还是提示: [ERROR] Can't find error-message
file 'D:\mysql-5.7.17-winx64\bin\%MYSQL_HOME%\share\%MYSQL_HOME% hare\english\errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
明显目录不对,于是我就把参考链接中的配置脚本上,关于配置目录的全部注释掉,OK ,默认目录都是对的了。成功!
附上操作图片和最后的my.ini 配置脚本。
#########################################################
[client]
port=3306
default-character-set=utf8
[mysqld]
#basedir=%MYSQL_HOME%
#解压目录
#language=%MYSQL_HOME%\share\english
port=3306
character_set_server=utf8
#datadir=%MYSQL_HOME%\data
#解压目录下data目录
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[WinMySQLAdmin]
%MYSQL_HOME%\bin\mysqld.exe
########
==========================分界线=============================================================================================
刚安装好后,按道理是没有root密码的,但是我这就是有密码,而且我还不知道密码,显示如下:
D:\>mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
D:\>mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
处理方法是在my.ini 文件里[mysqld]下面添加一句:skip-grant-tables
顾名思义,数据库启动的时候
跳跃权限表的限制,不用验证密码,直接登录。
net stop MySQL 关闭数据库服务,然后net start MySQL 打开,
这个时候在登录就不需要密码了,显示如下:
D:\>mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.17 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
现在是免密码登录了,修改密码方法待续
mysql> update user set authentication_string=password('123123') where user='root' and Host='localhost'
============================================================
======================================================================================
首先,我是照着这个链接安装的: http://blog.csdn.net/rebirth_love/article/details/53608483 数据库可以安装成功,但是服务不能启动。
其中评论区有提到,要在第四步执行mysqld --initialize --user=mysql --console 初始化
但是按照他这样做还是不成功,我是装在D盘,D:\mysql-5.7.17-winx64\
首先,如果你不是在D:\mysql-5.7.17-winx64\bin
比如你在cmd 默认目录下执行mysqld --initialize --user=mysql --console ,则会提示: [ERROR]
Can't find error-message file 'C:\WINDOWS\system32\%MYSQL_HOME%\share\errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
所以是目录不对,要切到D:\mysql-5.7.17-winx64\bin 目录,但是还是提示: [ERROR] Can't find error-message
file 'D:\mysql-5.7.17-winx64\bin\%MYSQL_HOME%\share\%MYSQL_HOME% hare\english\errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
明显目录不对,于是我就把参考链接中的配置脚本上,关于配置目录的全部注释掉,OK ,默认目录都是对的了。成功!
附上操作图片和最后的my.ini 配置脚本。
#########################################################
[client]
port=3306
default-character-set=utf8
[mysqld]
#basedir=%MYSQL_HOME%
#解压目录
#language=%MYSQL_HOME%\share\english
port=3306
character_set_server=utf8
#datadir=%MYSQL_HOME%\data
#解压目录下data目录
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[WinMySQLAdmin]
%MYSQL_HOME%\bin\mysqld.exe
########
==========================分界线=============================================================================================
刚安装好后,按道理是没有root密码的,但是我这就是有密码,而且我还不知道密码,显示如下:
D:\>mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
D:\>mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
处理方法是在my.ini 文件里[mysqld]下面添加一句:skip-grant-tables
顾名思义,数据库启动的时候
跳跃权限表的限制,不用验证密码,直接登录。
net stop MySQL 关闭数据库服务,然后net start MySQL 打开,
这个时候在登录就不需要密码了,显示如下:
D:\>mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.17 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
现在是免密码登录了,修改密码方法待续
mysql> update user set authentication_string=password('123123') where user='root' and Host='localhost'
============================================================
相关文章推荐
- 【已解决】Mysql-5.7.19(win10-64) 安装后首次使用,workbench连接root用户,但要求输入密码
- mysql-5.7.17-winx64免安装版,win10环境下安装配置
- mysql-5.7.17-winx64免安装版,win10环境下安装配置
- mysql-5.7.17-winx64免安装版,win10环境下安装配置
- Mysql 5.7.17 winx64免安装版,win10环境下安装配置图文教程
- mysql-5.5.50-winx64解压版的安装与修改密码
- 6、单机运行环境搭建之 --CentOS-6.4安装MySQL 5.6.10并修改MySQL的root用户密码
- Centos:新安装mysql修改root密码
- mysql-5.7.11-winx64 免安装版(MySQL ZIP Archive版)配置及密码问题处理
- mysql 安装无法登录无法修改root密码
- CentOS 6.3 安装 MySQL 5.6.15并修改MySQL的root用户密码
- MySQL下载、安装和修改root密码
- CentOS-6.4安装MySQL 5.6.10并修改MySQL的root用户密码
- Linux mysql安装修改root密码服务
- mysql5.6.17 zip安装、卸载及root密码修改
- mysql-5.7.11-winx64.zip解压缩安装时root的默认密码
- 安装好MySQL后,用SQL去修改root帐号的密码,结果不能登录了!
- 刚安装时mysql不能修改密码以及忘记root密码
- MySQL Server 5.0 下载与 安装指南[图文] (安装到非系统路径+设置root账号对应密码)
- mysql-5.6.24-winx64 在win10安装