MySQL5.7 (zip archive)ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using passwor

1.  从官网下载zip archive版本http://dev.MySQL.com/downloads/mysql/

2. 解压缩至相应目录,并配置环境变量(将*\bin添加进path中);

3. (重要)在根目录新建my.ini文件,写入以下内容:

[plain]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. [mysql]  
  2. # 设置mysql客户端默认字符集  
  3. default-character-set=utf8  
  4. [mysqld]  
  5. # 设置3306端口  
  6. port = 3306   
  7. # 设置mysql的安装目录  
  8. basedir=D:\Database\MySQL Server 5.7  
  9. # 设置mysql数据库的数据的存放目录  
  10. datadir=D:\Database\MySQL Server 5.7\data  
  11. # 允许最大连接数  
  12. max_connections=200  
  13. # 服务端使用的字符集默认为8比特编码的latin1字符集  
  14. character-set-server=utf8  
  15. # 创建新表时将使用的默认存储引擎  
  16. default-storage-engine=INNODB   
  17. # 跳过密码验证  
  18. #skip-grant-tables  
4. 运行cmd(切记要用管理员身份);

5. (重要)执行命令mysqld --initialize

## 该步骤非常重要,因为之前的版本直接执行install命令便可安装服务,5.7之后需要初始化生成数据库文件(根目录下的data文件),否则后续无法启动服务;

6. 执行命令mysqld install,安装服务;

7. 执行命令net start mysql,启动服务;(停止服务net stop mysql)

8. 执行命令mysql -uroot -p,会报错ERROR 1045(28000),需要设置登录密码;

9. 打开配置文件my.ini,将skip-grant-tables前面的#去掉,然后重启服务,再次登录就可略过密码;

10. 进入mysql数据库,依次执行以下命令:

use mysql;

update user set authentication_string=password("root") where user="root";

flush privileges;

quit;

11. 打开配置文件my.ini,在skip-grant-tables前面加上#注释掉,然后重启服务,使用设置的密码再次登录;

12. 输入命令show databases,报错ERROR 1820 (HY000);

13. 修改一次密码set password=password("root");

14. 至此安装完成;




在启动mysql服务的时候可能会碰到mysql服务不能启动,又没有报错!





如果你想查看错误信息可输入:mysqld --console  启动错误信息



本人是根据下面信息排除错误

我的错误是下面红色字体部分解决的


Win7系统中提示:本地无法启动MySQL服务,报的错误:1067,进程意外终止的解决方法。
在本地计算机无法启动MYSQL服务错误1067进程意外终止。
这种情况一般是my.ini文件配置出错了
1、首先找到这个文件: Win7下的默认安装路径
C:\ProgramData\MySQL\MySQL Server 5.6\my.ini
打开此文件找到:default-storage-engine=INNODB
将default-storage-engine的值改为:MYISAM。
2、但是还有问题:因为以前你创建的那些数据库还是存在的(如果没有删除),
默认路径:
C:\ProgramData\MySQL\MySQL Server 5.6\data
这时可能会出来这种问题:
第一次设置的efault-storage-engine与第二次设置的值不一样,可能会导致 
(1)发现无法选择添加事务支持数据引擎InnoDB
(2)可能会说不支持InnoDB等
解决方法:
删除:C:\ProgramData\MySQL\MySQL Server 5.6\data目录下的
ib_logfile0
ib_logfile1
ibdata1
重启服务,再次生成就OK了

3、如果还是不行,检查
C:\ProgramData\MySQL\MySQL Server 5.6\data 这个目录中的错误日志(扩展名我为.err),显示如下内容:
2015-06-24 08:53:30 7736 [Note] Plugin 'FEDERATED' is disabled.
2015-06-24 08:53:30 1724 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
2015-06-24 08:53:30 7736 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-06-24 08:53:30 7736 [Note] InnoDB: The InnoDB memory heap is disabled
2015-06-24 08:53:30 7736 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2015-06-24 08:53:30 7736 [Note] InnoDB: Memory barrier is not used
2015-06-24 08:53:30 7736 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-06-24 08:53:30 7736 [Note] InnoDB: Not using CPU crc32 instructions
2015-06-24 08:53:30 1724 InnoDB: Error: unable to create temporary file; errno: 2
2015-06-24 08:53:30 7736 [ERROR] Plugin 'InnoDB' init function returned error.
2015-06-24 08:53:30 7736 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2015-06-24 08:53:30 7736 [ERROR] Unknown/unsupported storage engine: INNODB
2015-06-24 08:53:30 7736 [ERROR] Aborting
其中核心提示是这句,临时文件无法创建:
2015-06-24 08:53:30 1724 InnoDB: Error: unable to create temporary file; errno: 2

因此查看my.ini
[mysqld]区段内加入:
#自己指定的临时文件目录
tmpdir=d:\mysqltemp
d:\mysqltemp这个目录可以自己指定




end.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值