1045无法登录MySQL服务器

时间:2013-07-29 00:55:07

标签: mysql phpmyadmin

我下载后:

  • Wampserver 2.4
  • Apache版本2.4.4
  • PHP版本5.4.12
  • MySQL版本5.6.12

在Wampserver 2.4上,make put online - >全部开始 - >单击localhost - >单击phpMyAdmin。

在phpMyAdmin屏幕上:

  

欢迎使用phpMyAdmin

     

语言 - 英语

     

登录

     

用户名

     

密码

phpMyAdmin需要用户名和密码。

我没有为phpMyAadmin制作任何用户名和密码。

我不知道,但如果我插入一些用户名和密码, 它说:

  

1045无法登录MySQL服务器

请让我知道我做错了什么。

供您参考, wamp\apps\phpmyadmin4.0.4\config.in.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 setup/

 *
 * All directives are explained in documentation in the doc/ folder
 * or at <http://docs.phpmyadmin.net/>.
 *
 * @package PhpMyAdmin
 */

/*
 * This is needed for cookie based authentication to encrypt password in
 * cookie
 */
$cfg['blowfish_secret'] = 'a8b7c6d'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

/*
 * 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 mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

/*
 * phpMyAdmin configuration storage settings.
 */

/* User used to manipulate with storage */
// $cfg['Servers'][$i]['controlhost'] = '';
// $cfg['Servers'][$i]['controluser'] = 'pma';
// $cfg['Servers'][$i]['controlpass'] = 'pmapass';

/* Storage database and tables */
// $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]['table_uiprefs'] = 'pma__table_uiprefs';
// $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
// $cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
// $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
// $cfg['Servers'][$i]['recent'] = 'pma__recent';
/* Contrib / Swekey authentication */
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';

/*
 * End of servers configuration
 */

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

/**
 * Defines whether a user should be displayed a "show all (records)"
 * button in browse mode or not.
 * default = false
 */
//$cfg['ShowAll'] = true;

/**
 * Number of rows displayed when browsing a result set. If the result
 * set contains more rows, "Previous" and "Next".
 * default = 30
 */
//$cfg['MaxRows'] = 50;

/**
 * disallow editing of binary fields
 * valid values are:
 *   false    allow editing
 *   'blob'   allow editing except for BLOB fields
 *   'noblob' disallow editing except for BLOB fields
 *   'all'    disallow editing
 * default = blob
 */
//$cfg['ProtectBinary'] = 'false';

/**
 * Default language to use, if not browser-defined or user-defined
 * (you find all languages in the locale folder)
 * uncomment the desired line:
 * default = 'en'
 */
//$cfg['DefaultLang'] = 'en';
//$cfg['DefaultLang'] = 'de';

/**
 * default display direction (horizontal|vertical|horizontalflipped)
 */
//$cfg['DefaultDisplay'] = 'vertical';


/**
 * How many columns should be used for table display of a database?
 * (a value larger than 1 results in some information being hidden)
 * default = 1
 */
//$cfg['PropertiesNumColumns'] = 2;

/**
 * Set to true if you want DB-based query history.If false, this utilizes
 * JS-routines to display query history (lost by window close)
 *
 * This requires configuration storage enabled, see above.
 * default = false
 */
//$cfg['QueryHistoryDB'] = true;

/**
 * When using DB-based query history, how many entries should be kept?
 *
 * default = 25
 */
//$cfg['QueryHistoryMax'] = 100;

/*
 * You can find more configuration options in the documentation
 * in the doc/ folder or at <http://docs.phpmyadmin.net/>.
 */
?>

3 个答案:

答案 0 :(得分:7)

使用默认密码登录:

  

用户名:root

     

密码:[null]

使用[null]我的意思是根本没有密码。

答案 1 :(得分:1)

安装完成后,在“开始”菜单上,右键单击“启动WampServer”和“以管理员身份运行”。 然后可以没有任何密码以root用户身份登录MySQL(PHPMyAdmin)。

(在我的情况下,Windows 7机器上的安装是由具有管理员角色的用户完成的。 但是当我试图点击“启动WampServer”时,它只会上升到橙色。在搜索了几个指向更改某个配置文件的博客之后,上面发生了我,它起作用了。

答案 2 :(得分:0)

1)打开MySQL控制台 - 使用wamp,左键单击位于桌面右下角的WAMP图标,然后单击MySQL Console 系统将提示您输入密码,如果您有密码,则可以忽略以下步骤

按ENTER键 输入:使用mysql

按ENTER键

2)在命令行中输入以下内容

设置MySQL密码:UPDATE mysql.user SET Password = PASSWORD(&#34; EnterYourPasswordHere&#34;)WHERE User =&#34; root&#34 ;; 替换&#34; EnterYourPasswordHere&#34;使用您新选择的密码。

按ENTER键。

冲洗特权: 输入FLUSH PRIVILEGES;

键入退出:退出

然后按ENTER

3)打开并编辑位于本地服务器文件中的config.inc.php文件

转到我的电脑&gt; C驱动器&gt; (您的本地服务器文件夹,WAMP / MAMP / XAMPP)&gt; APPS&gt; PHPMYADMIN&gt; config.inc.php文件 找到以下代码行:$ cfg [&#39;服务器&#39;] [$ i] [&#39;密码&#39;] =&#39;&#39 ;; // MySQL密码

更改密码&#39;到您从步骤2创建的新选择的密码。

单击“保存”。

4)您可以访问http://localhost/phpMyAdmin/来访问phpMyAdmin。

恭喜!您现在可以访问您的数据库。