首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >1045无法登录到MySQL服务器

问1045无法登录到MySQL服务器
EN

Stack Overflow用户
提问于 2013-07-29 00:55:06
回答 3查看 33.2K关注 0票数 1

下载后:

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

在Wampserver2.4上,让put online ->启动所有->,单击localhost ->单击phpMyAdmin。

在phpMyAdmin屏幕上:

欢迎来到phpMyAdmin 语言-英语 登录 用户名 密码

phpMyAdmin需要用户名和密码。

我没有为phpMyAadmin设置任何用户名和密码。

我不知道,但如果我插入一些用户名和密码,上面写着:

1045无法登录到MySQL服务器

请告诉我我做错了什么。

供您参考,wamp\apps\phpmyadmin4.0.4\config.in.php代码:

代码语言:javascript
复制
<?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/>.
 */
?>
EN

回答 3

Stack Overflow用户

发布于 2013-07-29 00:56:39

使用默认密码登录:

用户名: root 密码:空

如果为null,我的意思是根本没有密码。

票数 7
EN

Stack Overflow用户

发布于 2014-02-21 05:02:32

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

(在我的例子中,windows 7计算机上的安装是由一个具有管理角色的用户完成的。但是当我试图点击"start WampServer“时,它只会变成橙色。在搜索了几个指向更改某些配置文件的博客之后,我想到了上面的情况,并且它成功了)。

票数 1
EN

Stack Overflow用户

发布于 2015-03-11 08:48:47

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

按ENTER Type in:使用mysql

按下回车

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

要设置您的MySQL密码:更新mysql.user set Password=PASSWORD( "EnterYourPasswordHere“)所在的User="root";将”EnterYourPasswordHere“替换为您新选择的密码。

按回车。

刷新特权:键入刷新权限;

输入退出:退出

然后进入

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

转到我的计算机>C驱动器>(您的本地服务器文件夹,WAMP/MAMP/XAMPP) > APPS > PHPMYADMIN > config.inc.php找到这一行代码:$cfg‘Server’密码‘=’;// MySQL密码

将“密码”更改为您从步骤2创建的新选择的密码。

单击保存。

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

祝贺你!您现在可以访问数据库了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17914571

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档