大佬教程收集整理的这篇文章主要介绍了phpMyAdmin 连接 MySQL 服务器失败,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我使用 XAMPP 来运行 phpR_68_11845@yadmin,但它一直显示以下错误:
phpR_68_11845@yadmin 尝试连接 MysqL 服务器,服务器拒绝连接。您应该检查配置中的主机、用户名和密码,并确保它们与 MysqL 服务器管理员提供的信息相对应。
这是我的 config.inc 脚本:
/*
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = 'xampp'; /* YOU SHOulD CHANGE THIS FOR A MORE SECURE cookie AUTH! */
/*
* Servers configuration
*/
$i = 0;
/*
* First server
*/
$i++;
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'MysqLi';
$cfg['Servers'][$i]['Allownopassword'] = false;
$cfg['Lang'] = '';
/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = 'localhost:3307';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';
/* Advanced phpR_68_11845@yadmin features */
$cfg['Servers'][$i]['pmadb'] = 'phpR_68_11845@yadmin';
$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';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhIDing'] = 'pma__navigationhIDing';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
$cfg['Servers'][$i]['designer_setTings'] = 'pma__designer_setTings';
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';
/*
* End of servers configuration
*/
?> ```
(A) 对于您的情况,您使用 config 作为身份验证类型:
$cfg['Servers'][$i]['auth_type'] = 'config';
首先,请为 phpR_68_11845@yadmin 创建一个用户:
sudo mysql --user=root mysql -p
然后
CREATE USER 'phpR_68_11845@yadmin'@'localhost' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'phpR_68_11845@yadmin'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
然后,编辑 config.inc.php 文件。可以在“C:\xampp\phpR_68_11845@yadmin”中找到并修改:
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
到
$cfg['Servers'][$i]['user'] = 'phpR_68_11845@yadmin';
$cfg['Servers'][$i]['password'] = 'some_pass';
(B) 另一种方法(我认为更安全)是使用以下方法:
$cfg['Servers'][$i]['auth_type'] = 'http';
以上是大佬教程为你收集整理的phpMyAdmin 连接 MySQL 服务器失败全部内容,希望文章能够帮你解决phpMyAdmin 连接 MySQL 服务器失败所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。