Home php教程 php手册 phpMyAdmin 安装配置方法和问题解决

phpMyAdmin 安装配置方法和问题解决

Jun 13, 2016 pm 12:23 PM
phpmyadmin and review Install method of Simple solve meet Configuration question

现作个简单回顾:基本上应该遇到的问题都遇到了,关键是多查资料,多动脑子就能解决问题的。
1/无法载入mcrypt扩展,请检查PHP配置;
2/配置文件现在需要绝密的短语密码(blowfish_secret);
3/#2003-服务器没有响应。

由于目前phpMyAdmin的最新版本已经更新到了3.1.3.1,网上流传的很多配置方法都是以前老版本的,已经不太适应新版本的配置要求;于是pharmar顺便也把phpMyAdmin3.1.3.1的配置步骤也列在下面;为了切换及调试PHP方便,我采用的是windows系统,本地调试。

1、先下载phpMyAdmin安装包:
到国外官方网站http://www.phpmyadmin.net/上,点击导航栏上的“DOWNLOADS”链接进入下载页面,选择“all-languages.zip”版本下载到本地,解压;把解压缩文件放到系统指定的虚拟根目录下的phpmyadmin文件夹里(可自定义文件夹名),如pharmar的本地存放位置是D:\Program Files\Apache\htdocs\Phpadmin里。

2、找到phpmyadmin文件夹里的config.sample.inc.php文件,重命名为config.inc.php文件。用支持UTF-8编码的写字板打开进行编辑。

3、查找 $cfg['Servers'][$i]['host'] = 'localhost';(通常用默认,也有例外,可以不用修改)

5、查找 $cfg['Servers'][$i]['auth_type'] = 'cookie';
在自己的机子里调试用config;如果在网络上的空间用cookie,这里我们既然在前面已经添加了网址,就修改成cookie。
我个人建议:无论是本地还是网络上,都建议设置成cookie,安全第一。
同时,当auth_type这个值设置为cookie后,还有一个地方需要作出相应的修改:
$cfg['blowfish_secret'] = '';
改成:$cfg['blowfish_secret'] = '123456';
这里的'123456'自己随便定义,不超过46个字符。如果这个地方留空,将会出现上文提到的第2个错误:“配置文件现在需要绝密的短语密码(blowfish_secret)”。

6、查找 $cfg['Servers'][$i]['user'] = 'root'; // MySQL user(用户名,自己机里用root;在网上一般为你的ftp用户名,虚拟主机提供商会告诉你的;一般不要修改)

7、查找 $cfg['Servers'][$i]['password'] = '123456'; // MySQL password (123456修改成连接你的MYSQL数据库的用户密码)

到这里,phpMyAdmin就已经配置完成OK;你可以打开http://localhost/phpmyadmin/访问方便快捷的图形化管理软件phpMyAdmin了。关于本文没有提到的配置文件里的其他选项,大家可以不用关心了也不必修改。关于具体如何操作phpMyAdmin不在本文讨论的范围内,不过图形化界面,是通俗易懂,稍微看看就会用了(参考)。

下面谈谈,pharmar在安装配置phpMyAdmin的过程中所遇到的几个问题。

第一个问题:“无法载入mcrypt扩展,请检查PHP配置”。

1、没有正确安装Mysql数据库,在系统服务中Mysql相关的服务没有启动。
2、在系统的 system32(C:\windows\system32) 目录下缺少 libmcrypt.dll文件,解决方法是找到php目录下的libmcrypt.dll,并将libmcrypt.dll复制到C:\windows\system32目录中,然后重新启动Web服务。
3、在PHP目录下的php.ini文件中,没有将“;extension=php_mcrypt.dll”中的前面一个“;”去掉,所以不能使用相应功能,解决方法是打开php.ini文件,找到;extension=php_mcrypt.dll改成extension=php_mcrypt.dll //去掉前面的;使之生效
4、Mysql目录没有读取权限,正确的目录权限如下:
administrator 完全控制
system 完全控制
user 读取加运行
其他的用户权限全部删除(也可保留,但安全性不高,建议删除),然后重启MYsql服务和Web服务(建议修改此项后重启一下服务器)。
5、以上方法都不行的话,再用这个方法:桌面>我的电脑>右键属性>高级>环境变量>系统变量>新建
名:phpdir
值:D:\Program Files\Php(你的PHP在什么目录就是什么)
(参考来源:地址)

第二个问题:“无法载入 mysql 扩展,请检查 PHP 配置”

把 PHP 目录下的 libmySQL.dll 复制到:c:\windows\system32 下,然后重启APACHE。

第三个问题:“#2003-服务器没有响应”。

遇到这个问题多半是MYSQL数据库没有启动,建议直接在在:控制面板-管理工具-服务里面把MYSQL启动。关于是否启动,你可以在任务管理器里查看是否有“mysqld-nt.exe”这样的进程,如有有,则说明mysql已经启动。
 还有一个重要原因就是安装的时候端口不是默认3306,比如我就是,在安装过程中,由于有程序占用了3306,我就改成了3307因此无论如何都显示:“#2003-服务器没有响应”。最后终于找到原因。只要在加一条即可:
$cfg['Servers'][$i]['port'] = '3307';

第四个问题:“没有发现PHP的扩展设置mbstring”。

修改 C:\WINDOWS\ 下的 PHP.INI 文件,找到 ;extension=php_mbstring.dll 把;去掉,保存 PHP.INI,重新启动Apache即可。

这些问题,不碰到便罢了。但是对于新手来说,第一次碰到的话,自己查找解决方案的话一般都是到处查找,网上一大堆的方法都不适用的情况下,自己会感觉到多么的无奈了。一定要看官方的说明文档,虽然是英文的,但是还是很有用的。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to set primary key in phpmyadmin How to set primary key in phpmyadmin Apr 07, 2024 pm 02:54 PM

The primary key of a table is one or more columns that uniquely identify each record in the table. Here are the steps to set a primary key: Log in to phpMyAdmin. Select database and table. Check the column you want to use as the primary key. Click "Save Changes". Primary keys provide data integrity, lookup speed, and relationship modeling benefits.

Where does the wordpress database exist? Where does the wordpress database exist? Apr 15, 2024 pm 10:39 PM

The WordPress database is housed in a MySQL database that stores all website data and can be accessed through your hosting provider’s dashboard, FTP, or phpMyAdmin. The database name is related to the website URL or username, and access requires the use of database credentials, including name, username, password, and hostname, which are typically stored in the "wp-config.php" file.

How to recover deleted contacts on WeChat (simple tutorial tells you how to recover deleted contacts) How to recover deleted contacts on WeChat (simple tutorial tells you how to recover deleted contacts) May 01, 2024 pm 12:01 PM

Unfortunately, people often delete certain contacts accidentally for some reasons. WeChat is a widely used social software. To help users solve this problem, this article will introduce how to retrieve deleted contacts in a simple way. 1. Understand the WeChat contact deletion mechanism. This provides us with the possibility to retrieve deleted contacts. The contact deletion mechanism in WeChat removes them from the address book, but does not delete them completely. 2. Use WeChat’s built-in “Contact Book Recovery” function. WeChat provides “Contact Book Recovery” to save time and energy. Users can quickly retrieve previously deleted contacts through this function. 3. Enter the WeChat settings page and click the lower right corner, open the WeChat application "Me" and click the settings icon in the upper right corner to enter the settings page.

How to add foreign keys in phpmyadmin How to add foreign keys in phpmyadmin Apr 07, 2024 pm 02:36 PM

Adding a foreign key in phpMyAdmin can be achieved by following these steps: Select the parent table that contains the foreign key. Edit the parent table structure and add new columns in "Columns". Enable foreign key constraints and select the referencing table and key. Set update/delete operations. save Changes.

What is the password for the phpmyadmin account? What is the password for the phpmyadmin account? Apr 07, 2024 pm 01:09 PM

The default username and password for PHPMyAdmin are root and empty. For security reasons, it is recommended to change the default password. Method to change password: 1. Log in to PHPMyAdmin; 2. Select "privileges"; 3. Enter the new password and save it. When you forget your password, you can reset it by stopping the MySQL service and editing the configuration file: 1. Add the skip-grant-tables line; 2. Log in to the MySQL command line and reset the root password; 3. Refresh the permission table; 4. Delete skip-grant-tables line, restart the MySQL service.

How to delete data table in phpmyadmin How to delete data table in phpmyadmin Apr 07, 2024 pm 03:00 PM

Steps to delete a data table in phpMyAdmin: Select the database and data table; click the "Action" tab; select the "Delete" option; confirm and perform the deletion operation.

Where is the phpmyadmin log? Where is the phpmyadmin log? Apr 07, 2024 pm 12:57 PM

Default location for PHPMyAdmin log files: Linux/Unix/macOS:/var/log/phpmyadminWindows: C:\xampp\phpMyAdmin\logs\ Log file purpose: Troubleshooting Audit Security

why phpmyadmin access denied why phpmyadmin access denied Apr 07, 2024 pm 01:03 PM

Reasons and solutions for access denied by phpMyAdmin: Authentication failed: Check whether the username and password are correct. Server configuration error: adjust firewall settings and check whether the database port is correct. Permissions issue: Granting users access to the database. Session timeout: Refresh the browser page and reconnect. phpMyAdmin configuration error: Check the configuration file and file permissions to make sure the required Apache modules are enabled. Server issue: Wait for a while and try again or contact your hosting provider.

See all articles