#1045 – Access denied for user ‘root’@’localhost’ (using password: YES

來源:互聯網
上載者:User

關於這個問題,在網上找了好多方法都不管用

我用的php-4.4.1+mysql-4.0.26+Windows2000專業版搭建的環境

PhpMyAdmin2.11.4 版本。

當以此安裝完後在WEB目錄下安裝了Discuz!6.0.0版本的論壇成功。

然後在安裝PhpMyAdmin2.11.4 後出現問題:問題如題目{    mysql #1045 - Access denied for user 'root'@'localhost' (using password: NO)   }

安裝PhpMyAdmin2.11.4 很簡單不多說了,直接下載解壓縮放在web目錄下就可以,我2000系統的目錄是C:/Inetpub/wwwroot/PhpMyAdmin

網上最多教的方法是從PhpMyAdmin/libraries目錄下 找到config.default.php 檔案然後複製到根目錄PhpMyAdmin下 改名字為 config.inc.php 然後修改裡面的內容等等

但是在PhpMyAdmin2.11.4 版本裡不需要,只要找到根目錄下的config.sample.inc.php檔案,複製裡面的內容到建立檔案config.inc.php裡就可以了。 config.inc.php要放在根目錄下。

然後修改裡面的內容為如下:(只修改紅色部分)

<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* phpMyAdmin sample configuration, you can use it as base for
* manual configuration. For easier setup you can use scripts/setup.php
*
* All directives are explained in Documentation.html and on phpMyAdmin
* wiki <http://wiki.cihar.com>.
*
* @version $Id: config.sample.inc.php 10142 2007-03-20 10:32:13Z cybot_tm $
*/

/*
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = '2156'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
//此句為注釋不需要,上面的2156是隨便值。

/*
* Servers configuration
*/
$i = 0;

/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'root';
$cfg['Servers'][$i]['controlpass'] = '123456';
/* Advanced phpMyAdmin features */
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
// $cfg['Servers'][$i]['relation'] = 'pma_relation';
// $cfg['Servers'][$i]['table_info'] = 'pma_table_info';
// $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
// $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
// $cfg['Servers'][$i]['column_info'] = 'pma_column_info';
// $cfg['Servers'][$i]['history'] = 'pma_history';
// $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';

/*
* End of servers configuration
*/

/*
* Directories for saving/loading files from server
*/
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';

?>

基本工作完成,現在試著開啟就會提示 如題的錯誤。
方法是 在C:/Inetpub/wwwroot/目錄下建立個檔案夾(例如:PMA)

然後把PhpMyAdmin檔案夾拖到PMA目錄下就OK了

訪問的目錄就應該是 http://localhost/PMA/phpmyadmin/index.php

如果前一步$cfg['blowfish_secret'] = '2156'; 沒有設定任意值的話,會提示錯誤資訊“設定檔現在需要絕密的短語密碼(blowfish_secret)”

忘記設定的話,快補上嘍,我也是新手,剛開始學PHP。 有不準確的描述多包含。

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.