XAMPP:访问phpmyadmin出错的解决方案,xamppphpmyadmin_PHP教程
程序员文章站
2022-05-06 15:27:19
...
XAMPP:访问phpmyadmin出错的解决方案,xamppphpmyadmin
来源:http://www.ido321.com/1246.html
XAMPP(Apache+MySQL+PHP+PERL)是一个功能强大的建 XAMPP 软件站集成软件包,轻巧,用起来很方便。它提供了强大的phpmyadmin数据库管理工具,让使用者对数据库的使用和管理得心应手。对于不能在本地打开 phpmyadmin的问题,我的解决方案如下:
MySQL有一个默认的专用端口:3306,所以,如果你之前独立安装了MySQL,那么3306端口已经被占用。安装XAMPP集成的MySQL时,必须重新设置独立的端口,否则是不能访问phpmyadmin的,我收到的报错信息见图:
修改方法也很方便,打开XAMPP的控制面板,找到mysql右侧的config,点击,会出现my.ini的选择项,这个就是mysql的配置文件了,如图:
当然只是修改端口,我还是访问不了。还要去修改phpmyadmin的配置文件,这里有两个途径:
一、访问phpmyadmin出错的解决方案
1、打开xampp目录(默认的安装目录,如果修改,请找到xampp的安装目录),打开phpmyadmin的目录,在该目录下找到config.inc.php,我的默认配置:
/* * 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'] = 'username'; //mysql用户名 $cfg['Servers'][$i]['password'] = 'password'; //mysql密码 $cfg['Servers'][$i]['extension'] = 'mysqli'; //扩展配置,若访问出现没有配置mysqli等错误,加上这个。默认是有的 $cfg['Servers'][$i]['AllowNoPassword'] = true; $cfg['Lang'] = ''; /* Bind to the localhost ipv4 address and tcp */ $cfg['Servers'][$i]['host'] = '127.0.0.1'; $cfg['Servers'][$i]['connect_type'] = 'tcp'; /* User for advanced features */ $cfg['Servers'][$i]['controluser'] = 'pma'; $cfg['Servers'][$i]['controlpass'] = ''; /* 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'; $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'; /* * End of servers configuration */ ?>
上一篇: PHP中读取照片exif信息的方法