简体   繁体   English

LAMP#1045-用户'root'@'localhost'的访问被拒绝(使用密码:NO)

[英]LAMP #1045 - Access denied for user 'root'@'localhost' (using password: NO)

I am somewhat new to xampp, but I was setting up my phpmyadmin MySQL server, and I reset the password for the root user @ localhost. 我对xampp有点陌生,但是我正在设置phpmyadmin MySQL服务器,并且我重置了root用户@ localhost的密码。 I was immediately shown the error #1045. 我立即看到错误#1045。 I did the research, and most solutions I found said to find the Config.inc.php file in my xampp folder. 我进行了研究,发现的大多数解决方案都说可以在xampp文件夹中找到Config.inc.php文件。 I located it, opened it in my text editor (Brackets 2), and changed the code 我找到了它,在我的文本编辑器(Brackets 2)中打开了它,并更改了代码

$cfg['Servers'][$i]['password']=''

to

$cfg['Servers'][$i]['password']='NO'.

Once I changed the code, I go to save, but I then receive an error saying I do not have permission to edit the configuration file. 更改代码后,我将进行保存,但是随后收到一条错误消息,提示我无权编辑配置文件。 I am using macOS Sierra version 10.12.4, XAMPP version 5.6.30-1. 我正在使用macOS Sierra版本10.12.4,XAMPP版本5.6.30-1。 Can anybody help? 有人可以帮忙吗?

before you run the editor command put the command sudo 在运行编辑器命令之前,请先放置命令sudo

sudo vi Config.inc.php

This will ask you to enter your password, and then will execute the command as an admin user (assuming you have that right :) ) 这将要求您输入密码,然后以管理员用户身份执行命令(假设您具有该权限:))

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SQLSTATE [28000] [1045]用户'root'@'localhost'的访问被拒绝(使用密码:NO) - SQLSTATE[28000][1045] Access denied for user 'root'@'localhost'(using password:NO) #1045-用户'root'@'localhost'的访问被拒绝(使用密码:是) - #1045 - Access denied for user 'root'@'localhost' (using password: YES) #1045-拒绝'root'@'localhost'访问(使用密码:是) - #1045 - Access denied for 'root'@'localhost' (using password: YES) (HY000/1045):使用 Windows 拒绝用户 'root'@'localhost'(使用密码:YES)的访问 - (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) using Windows SQLSTATE[HY000] [1045] 使用 Mac Os 和 MAMP 拒绝用户 'root'@'localhost' 的访问(使用密码:否) - SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) using Mac Os and MAMP 发生MySQL查询错误。 错误号:1045用户“ root” @“ localhost”的访问被拒绝(使用密码:否) - A MySQL query error has occurred. Error number: 1045 Access denied for user 'root'@'localhost' (using password: NO) FOSUserBundle-SQLSTATE [28000] [1045]用户'root'@'localhost'的访问被拒绝(使用密码:NO) - FOSUserBundle - SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO) 错误!:SQLSTATE[HY000] [1045] 用户 'root'@'localhost' 访问被拒绝(使用密码:NO) - ERROR!:SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) 错误1045:通过扩展类连接时,使用密码NO…拒绝用户'root'@'localhost'的访问 - error 1045: access denied for user 'root'@'localhost' using password NO… when connecting through extended classes,others mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (使用密码: NO) - mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM