设置

2.1 The error message “Warning: Cannot add header information - headers already sent by …” is displayed, what’s the problem?

Edit your config.inc.php file and ensure there is nothing (I.E. no blank lines, no spaces, no characters…) neither before the <?php tag at the beginning, neither after the ?> tag at the end.

2.2 phpMyAdmin can’t connect to MySQL. What’s wrong?

Either there is an error with your PHP setup or your username/password is wrong. Try to make a small script which uses mysql_connect and see if it works. If it doesn’t, it may be you haven’t even compiled MySQL support into PHP.

2.3 The error message “Warning: MySQL Connection Failed: Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (111) …” is displayed. What can I do?

The error message can also be: Error #2002 - The server is not responding (or the local MySQL server’s socket is not correctly configured).

First, you need to determine what socket is being used by MySQL. To do this, connect to your server and go to the MySQL bin directory. In this directory there should be a file named mysqladmin. Type ./mysqladmin variables, and this should give you a bunch of info about your MySQL server, including the socket (/tmp/mysql.sock, for example). You can also ask your ISP for the connection info or, if you’re hosting your own, connect from the ‘mysql’ command-line client and type ‘status’ to get the connection type and socket or port number.

Then, you need to tell PHP to use this socket. You can do this for all PHP in the php.ini or for phpMyAdmin only in the config.inc.php. For example: $cfg['Servers'][$i]['socket'] Please also make sure that the permissions of this file allow to be readable by your webserver.

On my RedHat-Box the socket of MySQL is /var/lib/mysql/mysql.sock. In your php.ini you will find a line

  1. mysql.default_socket = /tmp/mysql.sock

将其修改为

  1. mysql.default_socket = /var/lib/mysql/mysql.sock

之后重新启动 Apache,即可解决问题。

Have also a look at the corresponding section of the MySQL documentation.

2.4 Nothing is displayed by my browser when I try to run phpMyAdmin, what can I do?

Try to set the $cfg['OBGzip'] directive to false in the phpMyAdmin configuration file. It helps sometime. Also have a look at your PHP version number: if it contains “b” or “alpha” it means you’re running a testing version of PHP. That’s not a so good idea, please upgrade to a plain revision.

2.5 Each time I want to insert or change a row or drop a database or a table, an error 404 (page not found) is displayed or, with HTTP or cookie authentication, I’m asked to log in again. What’s wrong?

Check your webserver setup if it correctly fills in either PHP_SELF or REQUEST_URI variables.

If you are running phpMyAdmin behind reverse proxy, please set the $cfg['PmaAbsoluteUri'] directive in the phpMyAdmin configuration file to match your setup.

2.6 I get an “Access denied for user: ‘root@localhost’ (Using password: YES)”-error when trying to access a MySQL-Server on a host which is port-forwarded for my localhost.

When you are using a port on your localhost, which you redirect via port-forwarding to another host, MySQL is not resolving the localhost as expected. Erik Wasser explains: The solution is: if your host is “localhost” MySQL (the command line tool mysql as well) always tries to use the socket connection for speeding up things. And that doesn’t work in this configuration with port forwarding. If you enter “127.0.0.1” as hostname, everything is right and MySQL uses the TCP connection.

2.7 Using and creating themes

See Custom Themes.

2.8 I get “Missing parameters” errors, what can I do?

请先检查以下几点:

2.9 Seeing an upload progress bar

To be able to see a progress bar during your uploads, your server must have the uploadprogress extension, and you must be running PHP 5.4.0 or higher. Moreover, the JSON extension has to be enabled in your PHP.

If using PHP 5.4.0 or higher, you must set session.upload_progress.enabled to 1 in your php.ini. However, starting from phpMyAdmin version 4.0.4, session-based upload progress has been temporarily deactivated due to its problematic behavior.