1

I'm trying to log in on PhpMyAdmin on Centos7 but i can't. I'm sure that the login and password of MySQL are correct because i can log in to MySQL with command line. I'm using Mysql 8. I tried even to change the password and created a new user. The same problem persist The problem is when i try to connect to phpMyAdmin, i have this red message on the login interface:

Connexion au serveur MySQL non permise

Can someone help me please ?

Ahmed SEDDIK
  • 149
  • 12
  • 1
    Did you try doing `Flush Privileges`? ```CREATE USER 'user'@'localhost' IDENTIFIED BY 'some_pass'; GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost' WITH GRANT OPTION;``` – Ankit Jindal Apr 02 '22 at 15:28
  • 1
    Do you try this on 1 machine, or is PhpMyAdmin running on another machine then MySQL ? – Luuk Apr 02 '22 at 15:31
  • finally the ``FLUSH PRIVILEGES`` must go to apply the changes. – Javier G.Raya Apr 02 '22 at 15:33
  • @AnkitJindal yes i did it but it is usually the same problem. I can connect on Mysql only with command line. – Ahmed SEDDIK Apr 02 '22 at 16:12
  • @Luuk yes i'm trying to connect to phpMyAdmin on the same machine as MySQL – Ahmed SEDDIK Apr 02 '22 at 16:14
  • @JavierG.Raya The command FLUSH PRIVILEGES works on the command line but it deosn't have effects on phpMyAdmin, I can't login on phpMyAdmin – Ahmed SEDDIK Apr 02 '22 at 16:16
  • then I don't know anymore. Sorry – Javier G.Raya Apr 02 '22 at 16:18
  • Please show the config used for MySQL. i.e. [skip-networking](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_skip_networking) might cause PhpMyAdmin to stop connecting. – Luuk Apr 02 '22 at 17:13
  • @Luuk How can I show the config used for MySQL please ? – Ahmed SEDDIK Apr 02 '22 at 17:21
  • 1
    https://stackoverflow.com/questions/35144508/mysql-connection-only-works-through-command-line This answer might be helpful for you – Ankit Jindal Apr 02 '22 at 17:33
  • To show the configured settings add `--print-defaults` to the complete statement that is starting `mysqld` – Luuk Apr 02 '22 at 17:49
  • Are you connecting to the same exact host? To MySQL, `127.0.0.1` and `localhost` use different connection types (TCP/IP networking compared to sockets) which means permissions are also different for the two types. When you start the command line client, use the `STATUS;` command to see your connection type. The phpMyAdmin default is localhost (sockets) and at least on my system, the MySQL default is 127.0.0.1 (TCP/IP). You'll need to verify that the user you're trying to use has permissions for both sets of hosts, which usually looks like two different user accounts with different host fields. – Isaac Bennetch Apr 04 '22 at 00:40

1 Answers1

0

Try with MySQL native password, to use this login to your MySQL with the command line as you said you can. And then change the password as native password with this command:

ALTER USER your_db_username@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_current_password';

Optionally, you can change your privilege if need for any host; to change this use this command : GRANT ALL ON * . * TO your_db_username@'%';

and then use FLUSH PRIVILEGES; to apply the change.

And also check all the required PHP extensions are installed or not. like php-mbstring if not installed, install it with the command: yum install php-mbstring after that restart server if apache/httpd use the command: systemctl restart httpd

And then try to log in to phpMyadmin hope it works!