wamp mysql 无法连接到本地主机

发布于 2024-11-14 08:08:30 字数 2278 浏览 1 评论 0原文

你好 我试图按照在线教程在 mysql 中设置密码,但这现在导致了我无法恢复的错误。

1) phpMyAdmin-2.11.10 这会在登录框下方显示消息:无法加载 mcrypt。我已在 wamp 中启用,并将 libmcrypt.dll 放入 windows 和 windows\system32 文件夹中。但仍然收到消息。如果我将 root 放入登录框中而没有通过,这会导致第二个错误。

2) mysql 错误

1130 - 不允许主机“localhost”连接到此 MySQL 服务器

我尝试了各种修复,但似乎没有任何效果。如果有任何帮助,我将不胜感激。谢谢

phpMyAdmin-2.11.10 mysql4.1.22 php4.4.7

phpmyadmin 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.phpmyadmin.net>.
 *
 * @version $Id: config.sample.inc.php 12304 2009-03-24 12:56:58Z nijel $
 */

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

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

/*
 * First server
 */
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$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'] = 'pma';
// $cfg['Servers'][$i]['controlpass'] = 'pmapass';
/* 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'] = '';

?>

hello
i tried to follow an online tut for setting password in mysql and this has now led to errors that i cannot recover from.

1) phpMyAdmin-2.11.10
this gives login box with message underneath: cannot load mcrypt. i have enabled in wamp and also put libmcrypt.dll in windows and windows\system32 folders. but still get message.if i put root in login box with no pass, this leads to second error.

2) mysql error

1130 - Host 'localhost' is not allowed to connect to this MySQL server

i have tried various fixes but nothing seems to work. i would be grateful for any help. thanks

phpMyAdmin-2.11.10
mysql4.1.22
php4.4.7

phpmyadmin 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.phpmyadmin.net>.
 *
 * @version $Id: config.sample.inc.php 12304 2009-03-24 12:56:58Z nijel $
 */

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

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

/*
 * First server
 */
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$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'] = 'pma';
// $cfg['Servers'][$i]['controlpass'] = 'pmapass';
/* 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'] = '';

?>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

八巷 2024-11-21 08:08:30

据我所知,Wamp 附带已配置的 phpMyAdmin。你用过什么教程?

LE:

这是root用户还是其他帐户?如果我是你,我会备份我的数据(文件和 sql),进行全新的 wamp 安装(最新版本不是你教程中的版本)并执行以下操作:

  • 转到“开始”->“运行,输入 cmd
  • 使用 cd 命令导航到 mysql.exe 的安装位置

使用以下命令:

mysql>
mysql>update mysql.user SET password=password("newpassword") hit enter
mysql>where user="root"; hit enter
Query OK


mysql>Flush Privileges; hit enter
Query OK
mysql>quit hit enter
mysql>bye

然后转到 phpMyAdmin config.inc 并编辑

$cfg['Servers'][$i]['password'] = 'newpassword';

重新启动 WAMP 服务器,现在应该可以了。

As far as I know, Wamp comes with phpMyAdmin already configured. What tutorial did you have used?

LE:

Is this the root user or other account? If I were you, I would backup my data ( files and sql ), do a fresh wamp install ( the latest version not the one in your tutorial ) and do the following:

  • go to Start -> Run , enter cmd
  • use cd command to navigate where mysql.exe is installed

Use the following commands :

mysql>
mysql>update mysql.user SET password=password("newpassword") hit enter
mysql>where user="root"; hit enter
Query OK


mysql>Flush Privileges; hit enter
Query OK
mysql>quit hit enter
mysql>bye

Then go to phpMyAdmin config.inc and edit

$cfg['Servers'][$i]['password'] = 'newpassword';

Restart the WAMP server and should be ok now.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文