1

I'm encountering an error when logging in to phpMyAdmin on my local XAMPP setup. The login page displays the following errors:

mysqli::real_connect(): Premature end of data (mysqlnd_wireprotocol.c:387)
mysqli::real_connect(): GREET packet %Id bytes shorter than expected
mysqli::real_connect(): Error while reading greeting packet. PID=10920
mysqli::real_connect(): [2002] (trying to connect via (null))
mysqli::real_connect(): (HY000/2002):
Connection for controluser as defined in your configuration failed.

My Setup:

phpMyAdmin Configuration (config.inc.php):

$cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */
$i = 0;
$i++;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '33060'; // Ensure this matches the port MySQL is using
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = 'your_pma_password';

MySQL Configuration (my.cnf):

[mysqld]
port = 33060
socket = "C:/xampp/mysql/mysql.sock"
basedir = "C:/xampp/mysql"
tmpdir = "C:/xampp/tmp"
datadir = "C:/xampp/mysql/data"
pid_file = "mysql.pid"
log_error = "mysql_error.log"

Environment Details:

  • XAMPP Version: XAMPP 8.0.3
  • MySQL Version: 8.0.23
  • phpMyAdmin Version: 5.1.0
  • PHP Version: 8.0.3
  • Operating System: Windows 10

Steps Taken:

  1. Verified MySQL is Running: MySQL service is active and I can connect to it using the MySQL command line client.
  2. Checked Port Settings: Ensured that the port in config.inc.php matches the port in my.cnf.
  3. Validated Host: Ensured that localhost is correctly specified as the host in the configuration files.
  4. Reviewed Error Logs: Checked MySQL error logs for any additional information but found nothing that stands out.
  5. Standalone MySQL Installation: I have another standalone MySQL installation on my system, which might be causing conflicts.

Additional Information:

  • I recently changed the MySQL port settings to avoid conflicts with other services. This is when the issue started occurring.
  • There are no relevant entries in mysql_error.log related to this problem.
  • The standalone MySQL installation might be interfering with the MySQL server bundled with XAMPP.

Questions:

  1. Configuration Issues: Are there any apparent issues in my phpMyAdmin or MySQL configuration that could be causing these errors?
  2. Standalone MySQL Conflict: Could my standalone MySQL installation conflict with the MySQL bundled with XAMPP? If so, how can I resolve this conflict?
  3. Debugging Steps: What additional steps can I take to debug and resolve the "Premature end of data" and "GREET packet" errors on the phpMyAdmin login page?

Request for Assistance:

I am looking for insights into how to fix these errors to successfully log into phpMyAdmin. Any guidance on what might be wrong with my phpMyAdmin and MySQL configuration settings, and how to manage multiple MySQL installations on the same system, would be appreciated.


2
  • Okay thank you guys this problem has been solved
    – Misbagas
    Commented Jun 18 at 6:31
  • thank you for your attention
    – Misbagas
    Commented Jun 18 at 6:31

1 Answer 1

0

Your php configuration states that mysql is on port 33060, while your MySQL configuration makes mysql listen in 4000. This is a misconfiguration. Make sure php mysql Connect port is 4000.

3
  • Thank you for the advice, I updated the port settings: phpMyAdmin (config.inc.php): php $cfg['Servers'][$i]['port'] = '4000'; MySQL (my.cnf): ini [mysqld] port = 4000 socket = "C:/xampp/mysql/mysql.sock" After these changes, XAMPP shuts down when starting MySQL with the error: [mysql] Error: MySQL shutdown unexpectedly. Questions: 1. Could another application be using port 4000? 2. Could my standalone MySQL installation be causing conflicts? Thanks for any further guidance!
    – Misbagas
    Commented Jun 18 at 6:10
  • @Misbagas I understand from your edit and comment under it that you changed both your standalone MySQL and php conf to use 33060 and it works now. That would mean something else was running on port 4000 yes. You can find out what on windows using “netstat -anb” as administrator or “netstat -anp” on Linux. Commented Jun 18 at 17:17
  • alright dude, thanks
    – Misbagas
    Commented Jun 19 at 8:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .