我最近配置了两台服务器。首先使用Apache和phpMyAdmin。在另一台服务器上,我正确配置了一个 maria-DB 服务器。
phpMyAdmin 正在读取配置文件,但我无法连接到 MariaDB 服务器并且 PMA 正在抛出
#2002 Cannot log in to the MySQL server
Run Code Online (Sandbox Code Playgroud)

使用mysql命令从Web服务器连接到数据库服务器并使用相同的用户/密码,我可以成功连接到数据库服务器。
mysql中没有错误,mysql的所有端口都在防火墙中打开,没有php错误。我没有运气找到问题。
通过 Shell 访问服务器
[root@pw000i rafael]# mysql -h [IP ADRESS TO THE REMOTE SERVER] -u rafael -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 5.5.36-MariaDB-log MariaDB Server
Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.
Type 'help;' or '\h' for help. Type '\c' …Run Code Online (Sandbox Code Playgroud)