安装过程中出现错误 1045 MySQL

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10374962/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 13:10:28  来源:igfitidea点击:

Error 1045 MySQL during setup

mysql

提问by Falconx

Could anyone explain to me error 1045during MySQL setup. I'm getting this error after reinstalling. I 'm trying to install on windows 7. On the last stage of installation (i.e apply security settings) I'm getting the following message:

任何人都可以error 1045在 MySQL 安装过程中向我解释。重新安装后我收到此错误。我正在尝试在 Windows 7 上安装。在安装的最后阶段(即应用安全设置),我收到以下消息:

The security settings could not be applied. Error Number 1045.
Access denied for user 'root' @ 'loaclhost'(usinf password: NO).

How can I get around this?

我怎样才能解决这个问题?

回答by Torben

What worked for me on a 64 bit Windows 7 was

在 64 位 Windows 7 上对我有用的是

  1. Uninstall
  2. Remove C:\Program Files\MySQL
  3. Remove C:\ProgramData\MySQL (This folder may be hidden)
  4. Reinstall
  1. 卸载
  2. 删除 C:\Program Files\MySQL
  3. 删除 C:\ProgramData\MySQL(此文件夹可能被隐藏)
  4. 重新安装

回答by imdzeeshan

While re-Installing MySQL. Under Modify Security Settingsoption, check "current root password" field. If MySQLwas not installed earlier and this current root password field is visible, keep this empty. Fill in your new root password in next two fields. hope this solves your problem.

在重新安装MySQL. 在“修改安全设置”选项下,选中“当前 root 密码”字段。如果MySQL之前未安装并且此当前 root 密码字段可见,请将其保留为空。在接下来的两个字段中填写您的新 root 密码。希望这能解决您的问题。

enter image description here

在此处输入图片说明

回答by Keramat

This is a solution, Error 1045 MySql Instalation.

这是一个解决方案,错误 1045 MySql 安装。

  1. Stop MySql from running{control panel | Administrative Tools | Services}

  2. Make sure to uninstall the previous MySql from control panel

  3. remove all mysql directories and names from window explorer even those are hidden, In th case that there are some applications which are using mysql and are always on run and you can not remove the mysql dependencies from, you rename them. For example you have Ruby1.9, go head just rename it to RubyBack1.9 and rename them back once you finish with mysql installation. Or other alternative is you kill the process once you reach to step 9

  4. go to firewall from control panel, click on advanced setting in the left panel. Now, click on inbound rules. Add two mysql's under name one with Domain Profile the other with Private Profile.

  5. click on the one with Domain Profile you just have added.

  6. click on the Properties down in the right panel

  7. under scope tab on the top, click on the radio button and type 127.0.0.1

  8. under Protocol and Ports tab pick for protocol tcp and type for port 3306. Make sure to click OK to save the changes.

  9. restart your computer

  10. Now, go to the task manager and kill any mysql or its product jobs if any is running.

  11. Finally, re-install mysql-5.5.28-win32.msi or mysql-5.5.28-win64.msi accordingly.

  1. 停止 MySql 运行{控制面板 | 管理工具 | 服务}

  2. 确保从控制面板卸载以前的 MySql

  3. 从窗口资源管理器中删除所有 mysql 目录和名称,即使它们是隐藏的,如果有一些应用程序正在使用 mysql 并且始终在运行,并且您无法从中删除 mysql 依赖项,则可以重命名它们。例如,您有 Ruby1.9,只需将其重命名为 RubyBack1.9,并在完成 mysql 安装后将它们重命名。或者其他替代方法是,一旦到达第 9 步,就终止该进程

  4. 从控制面板转到防火墙,单击左侧面板中的高级设置。现在,单击入站规则。在名称下添加两个 mysql,一个是域配置文件,另一个是私有配置文件。

  5. 单击您刚刚添加的域配置文件。

  6. 单击右侧面板中的“属性”

  7. 在顶部的范围选项卡下,单击单选按钮并输入 127.0.0.1

  8. 在协议和端口选项卡下选择协议 tcp 并键入端口 3306。确保单击确定以保存更改。

  9. 重启你的电脑

  10. 现在,转到任务管理器并终止任何正在运行的 mysql 或其产品作业。

  11. 最后,相应地重新安装 mysql-5.5.28-win32.msi 或 mysql-5.5.28-win64.msi。

Good Luck

祝你好运

回答by Sebastien Chartier

This solution worked for me (http://dev.mysql.com/doc/refman/5.5/en/resetting-permissions.html) :

这个解决方案对我有用http://dev.mysql.com/doc/refman/5.5/en/resetting-permissions.html):

C.5.4.1.1. Resetting the Root Password: Windows Systems

C.5.4.1.1. 重置根密码:Windows 系统

On Windows, use the following procedure to reset the password for all MySQL root accounts:

在 Windows 上,使用以下过程重置所有 MySQL 根帐户的密码:

Log on to your system as Administrator.

以管理员身份登录您的系统。

Stop the MySQL server if it is running. For a server that is running as a Windows service, go to the Services manager: From the Start menu, select Control Panel, then Administrative Tools, then Services. Find the MySQL service in the list and stop it.

如果 MySQL 服务器正在运行,请停止它。对于作为 Windows 服务运行的服务器,请转至服务管理器:从开始菜单中,依次选择控制面板、管理工具和服务。在列表中找到 MySQL 服务并停止它。

If your server is not running as a service, you may need to use the Task Manager to force it to stop.

如果您的服务器没有作为服务运行,您可能需要使用任务管理器来强制它停止。

Create a text file containing the following statements. Replace the password with the password that you want to use.

创建一个包含以下语句的文本文件。将密码替换为您要使用的密码。

UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
FLUSH PRIVILEGES;

Write the UPDATE and FLUSH statements each on a single line. The UPDATE statement resets the password for all root accounts, and the FLUSH statement tells the server to reload the grant tables into memory so that it notices the password change.

将 UPDATE 和 FLUSH 语句分别写在一行上。UPDATE 语句重置所有 root 帐户的密码,FLUSH 语句告诉服务器将授权表重新加载到内存中,以便它注意到密码更改。

Save the file. For this example, the file will be named C:\mysql-init.txt.

保存文件。对于此示例,文件将命名为 C:\mysql-init.txt。

Open a console window to get to the command prompt: From the Start menu, select Run, then enter cmd as the command to be run.

打开控制台窗口以进入命令提示符:从开始菜单中,选择运行,然后输入 cmd 作为要运行的命令。

Start the MySQL server with the special --init-file option (notice that the backslash in the option value is doubled):

使用特殊的 --init-file 选项启动 MySQL 服务器(注意选项值中的反斜杠是双倍的):

C:\> C:\mysql\bin\mysqld --init-file=C:\mysql-init.txt

If you installed MySQL to a location other than C:\mysql, adjust the command accordingly.

如果您将 MySQL 安装到 C:\mysql 以外的位置,请相应地调整命令。

The server executes the contents of the file named by the --init-file option at startup, changing each root account password.

服务器在启动时执行由 --init-file 选项命名的文件的内容,更改每个 root 帐户密码。

You can also add the --console option to the command if you want server output to appear in the console window rather than in a log file.

如果您希望服务器输出显示在控制台窗口而不是日志文件中,您还可以将 --console 选项添加到命令中。

If you installed MySQL using the MySQL Installation Wizard, you may need to specify a --defaults-file option:

如果您使用 MySQL 安装向导安装 MySQL,则可能需要指定 --defaults-file 选项:

C:\> "C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld.exe"
         --defaults-file="C:\Program Files\MySQL\MySQL Server 5.5\my.ini"
         --init-file=C:\mysql-init.txt

The appropriate --defaults-file setting can be found using the Services Manager: From the Start menu, select Control Panel, then Administrative Tools, then Services. Find the MySQL service in the list, right-click it, and choose the Properties option. The Path to executable field contains the --defaults-file setting.

可以使用服务管理器找到适当的 --defaults-file 设置:从开始菜单中,选择控制面板,然后选择管理工具,然后选择服务。在列表中找到 MySQL 服务,右键单击它,然后选择 Properties 选项。可执行文件路径包含 --defaults-file 设置。

After the server has started successfully, delete C:\mysql-init.txt.

服务器启动成功后,删除C:\mysql-init.txt。

You should now be able to connect to the MySQL server as root using the new password. Stop the MySQL server, then restart it in normal mode again. If you run the server as a service, start it from the Windows Services window. If you start the server manually, use whatever command you normally use.

您现在应该能够使用新密码以 root 身份连接到 MySQL 服务器。停止 MySQL 服务器,然后再次以正常模式重新启动它。如果您将服务器作为服务运行,请从 Windows 服务窗口启动它。如果您手动启动服务器,请使用您通常使用的任何命令。

回答by user2859529

1) remove instance using MySQLServer Instance Config Wizard

1) 使用MySQL服务器实例配置向导删除实例

2) uninstall MySQL

2)卸载 MySQL

3) go to C:\Program Files (x86)or C:\Program Filesand delete MySQLfolder

3)转到C:\Program Files (x86)C:\Program Files删除MySQL文件夹

4) then go to C:\ProgramData(sometimes it's a hidden folder), find and delete MySQLfolder

4)然后去C:\ProgramData(有时它是一个隐藏文件夹),找到并删除MySQL文件夹

5) restart pc

5)重启电脑

6) reinstall MySQL

6)重新安装 MySQL

回答by Jim Garrison

Based on the minimal information you've provided, it sounds like you're using a database from the previous install that already has a root password defined.

根据您提供的最少信息,听起来您正在使用先前安装中已经定义了 root 密码的数据库。

Reinstall MySQL after first completelydeleting all directories into which you previously installed MySQL.

首先完全删除之前安装 MySQL 的所有目录后重新安装 MySQL。

EDIT:

编辑:

Also take a look at 2.10.2.1.5. Changes Made by MySQL Installation Wizardin the MySQL online manual. You may have to delete some registry keys.

另请查看2.10.2.1.5。MySQL 在线手册中MySQL 安装向导所做的更改。您可能需要删除一些注册表项。

回答by FSaeed

  1. Stop MySQL services from the Control Panel>> Administrative Services>> Services
  2. Uninstall from the Control panel
  3. Delete folder from Program files, Program Data and Program Files(x86)
  4. Remove the path from the Environment Variable ( Very important)
  5. Must uninstall MySQL Server, MySQL Workbench and installer
  1. 从控制面板中停止 MySQL 服务>>管理服务>>服务
  2. 从控制面板卸载
  3. 从程序文件、程序数据和程序文件(x86)中删除文件夹
  4. 从环境变量中删除路径(非常重要)
  5. 必须卸载 MySQL Server、MySQL Workbench 和安装程序

if leave the connectors to uninstall, it would not make any difference. Restart depend how efficient your machine is and then install again, it will be configured and will be running again without any error.

如果让连接器卸载,它不会有任何区别。重新启动取决于您的机器的效率,然后再次安装,它将被配置并再次运行而不会出现任何错误。

回答by manishbka

To resolve this error

要解决此错误

The security settings could not be applied. Error Number 1045. Access denied for user 'root' @ 'loaclhost'(usinf password: NO).

无法应用安全设置。错误编号 1045。用户“root”@“loaclhost”(usinf 密码:否)的访问被拒绝。

Please follow these steps:

请按照以下步骤操作:

  1. Uninstall the MySl server instance from the control panel
  2. Stop the service if it is re-running
  3. Remove all folders related to MySl from Program Files
  4. Remove the ProgramData folder from MySl Install Drive. This is a hidden folder - you'll have to make them visible. Also delete all folders related to MySl
  5. Download the MySl installer and check for your system type - the 32 bit installer should be mysql-essential-5.1win32and the 64 bit should be mysql-5.1.73-winx64
  6. Follow the installation instructions and choose the detailed configuration
  1. 从控制面板卸载 MySl 服务器实例
  2. 如果服务重新运行,请停止服务
  3. 从 Program Files 中删除与 MySl 相关的所有文件夹
  4. 从 MySl 安装驱动器中删除 ProgramData 文件夹。这是一个隐藏文件夹 - 您必须使它们可见。同时删除所有与 MySl 相关的文件夹
  5. 下载 MySl 安装程序并检查您的系统类型 - 32 位安装程序应该是mysql-essential-5.1win32,64 位应该是mysql-5.1.73-winx64
  6. 按照安装说明选择详细配置

If you follow these steps properly you should be able to resolve the issue

如果您正确执行这些步骤,您应该能够解决问题

回答by Mohd Kose Avase

  • Uninstall mySQL.
  • Go to C:\Program Files
  • Delete the MySQLfolder.
  • Reinstall mySQL.
  • 卸载mySQL.
  • C:\Program Files
  • 删除MySQL文件夹。
  • 重新安装mySQL

It will work.

它会起作用。