Home  >  Article  >  Database  >  How Can I Access phpMyAdmin After MySQL 8.0\'s Strong Password Requirements?

How Can I Access phpMyAdmin After MySQL 8.0\'s Strong Password Requirements?

Susan Sarandon
Susan SarandonOriginal
2024-11-22 14:39:16271browse

How Can I Access phpMyAdmin After MySQL 8.0's Strong Password Requirements?

Accessing phpMyAdmin on MySQL 8.0

The release of MySQL 8.0 introduced strong password requirements, leading to issues when accessing phpMyAdmin. However, there are several methods to resolve this problem.

Method 1: Modifying Authentication Method

  • Log into the MySQL console as the root user.
  • Execute the following command to change the Authentication Plugin:

    ALTER USER root IDENTIFIED WITH mysql_native_password BY 'PASSWORD';
  • Replace PASSWORD with the desired password.

Method 2: dockerized Environment

  • Create and start a MySQL container using Docker.
  • Use the following command to change the plugin:

    mysql -u root -pPASSWORD
    ALTER USER root IDENTIFIED WITH mysql_native_password BY 'PASSWORD';
  • Start a phpMyAdmin container and link it to the MySQL database.

Method 3: Changing Preferred Authentication Plugin

  • If using the mysql/mysql-server Docker image, execute:

    docker exec -it mysql sed -i -e 's/# default-authentication-plugin=mysql_native_password/default-authentication-plugin=mysql_native_password/g' /etc/my.cnf
  • Restart the MySQL container.
  • Apply the plugin change with:

    docker exec -it mysql mysql -u root -pPASSWORD -e "ALTER USER root IDENTIFIED WITH mysql_native_password BY 'PASSWORD';"

Method 4 (Workaround):

  • Execute the following command within the MySQL container:

    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
  • Ensure single quotes are used as shown.

Additional Notes

  • It is not recommended to alter the MySQL Preferred Authentication Plugin on production systems.
  • Consider updating to a newer version of phpMyAdmin, which may address this issue.

The above is the detailed content of How Can I Access phpMyAdmin After MySQL 8.0\'s Strong Password Requirements?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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