簡體   English   中英

連接到mysql時出現問題-用戶'root'@'localhost'的訪問被拒絕(使用密碼:是)

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

遇到PHP錯誤
嚴重程度: Warning

消息:mysqli :: real_connect():(HY000 / 1045):用戶'root'@'localhost'的訪問被拒絕(使用密碼:是)

文件名: mysqli/mysqli_driver.php

行號: 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

在中編輯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()
);

您可以在這里找到更多信息

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM