简体   繁体   English

连接到mysql时出现问题-用户'root'@'localhost'的访问被拒绝(使用密码:是)

[英]problem connecting to mysql - Access denied for user 'root'@'localhost' (using password: YES)

A PHP Error was encountered 遇到PHP错误
Severity: Warning 严重程度: Warning

Message: mysqli::real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) 消息:mysqli :: real_connect():(HY000 / 1045):用户'root'@'localhost'的访问被拒绝(使用密码:是)

Filename: mysqli/mysqli_driver.php 文件名: mysqli/mysqli_driver.php

Line Number: 203 行号: 203

Backtrace:

File: C:\\xampp\\htdocs\\ciblog\\application\\models\\Post_model.php Line: 4 Function: database

File: C:\\xampp\\htdocs\\ciblog\\index.php Line: 315 Function: require_once

Edit the database.php file in 在中编辑database.php文件

application/config/database.php application / config / database.php

$db['default'] = array(
    'dsn'   => '',
    'hostname' => 'localhost',
    'username' => 'root', // ADD USERNAME HERE
    'password' => '', // PASSWORD
    'database' => 'database_name', // DATABASE NAME
    'dbdriver' => 'mysqli',
    'dbprefix' => '',
    'pconnect' => TRUE,
    'db_debug' => TRUE,
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array()
);

You can find more info here 您可以在这里找到更多信息

暂无
暂无

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

相关问题 使用MAMP拒绝用户'root'@'localhost'的访问(使用密码:是) - Access denied for user 'root'@'localhost' (using password: YES) using MAMP 用户 'root'@'localhost' 的访问被拒绝(使用密码:YES)' - Access denied for user 'root'@'localhost' (using password: YES)' 用户'root'@'localhost'的访问被拒绝(使用密码:是) - Access denied for user 'root'@'localhost' (using password: YES) #1045-用户'root'@'localhost'的访问被拒绝(使用密码:是) - #1045 - Access denied for user 'root'@'localhost' (using password: YES) laravel 5用户“ root” @“ localhost”的访问被拒绝(使用密码:是) - laravel 5 Access denied for user 'root'@' localhost' (using password: YES) 警告:mysql_connect():用户'root'@'localhost'拒绝访问(使用密码:YES) - Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: YES) 当我尝试远程访问mysql时,拒绝用户'root'@'localhost'的访问(使用密码:是) - Access denied for user 'root'@'localhost' (using password: YES) when i try accessing mysql remotely 如何修复用户'root'@'localhost'的MySql异常访问被拒绝(使用密码:是) - How to fix MySql Exception Access denied for user 'root'@'localhost' (using password: YES) 无法连接到 MySQL:用户 'u201944136_root'@'localhost' 的访问被拒绝(使用密码:是) - Failed to connect to MySQL: Access denied for user 'u201944136_root'@'localhost' (using password: YES) 无法连接到 MySQL:用户 'root'@'localhost' 的访问被拒绝(使用密码:是) - Failed to connect to MySQL: Access denied for user 'root'@'localhost' (using password: YES)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM