PHPMyAdmin Can't connect to MYSQL

Hello,

Until today everything was working really great, but it’s been 2-3 days that I can’t connect to php myadmin through my cpanel.

Do you have any idea what would cause that?

I’m not sure if it could be linked, but I changed that in mysql:

[client]
port=3306
socket=/run/mysqld/mysqld.sock
default-character-set=utf8mb4

[mysql]
default-character-set=utf8mb4

[mysqld_safe]
socket=/run/mysqld/mysqld.sock

[mysqld]
user=mysql
pid-file=/run/mysqld/mysqld.pid
socket=/run/mysqld/mysqld.sock
port=3306
basedir=/usr
datadir=/var/lib/mysql
tmpdir=/tmp
lc-messages-dir=/usr/share/mariadb
log_error=/var/log/mysql/error.log
collation-server = utf8mb4_unicode_520_ci
init-connect='SET NAMES utf8mb4'
character-set-server = utf8mb4

symbolic-links=0
local-infile=0

skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 16M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

#innodb_use_native_aio = 0
innodb_file_per_table

max_connections=70
max_user_connections=30
wait_timeout=10
interactive_timeout=50
long_query_time=5

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/

Otherwise my configuration is pretty normal with nothing special!

Thanks in advance

Hi @nopix94944

I suppose by cpanel you mean Hestia Control Panel, otherwise, you might be in the wrong forum. :grinning_face_with_smiling_eyes:

Any errors? What do the logs say?

If you are using Nginx the log should be here /var/log/nginx/domains/HereYourDomain.error.log

If you are using Nginx+Apache, the log should be here /var/log/apache2/domains/HereYourDomain.error.log

1 Like

Hey,

Yes I meant hestia haha

 Impossible de se connecter au serveur MySQL (Impossible to connect to mysql server)

Langue *(Language)*

![]) mysqli::real_connect(): (HY000/1045): Access denied for user 'username'@'localhost' (using password: YES)

I’m on nginx only and error logs seems empty for my domain :frowning: (It exists but 0ko)

Can you connect from command line?

mariadb -u username -p
1 Like

it says “event not found” for the end of my password that ends in ^!qujen

Oh okay nevermind I’m stupid password was to enter after that, I’m getting error 1045 access denied

Well, seems the password is not the right one.

If you can access to the DB with root:

mariadb -uroot -e 'SHOW DATABASES;'

You could try to change the user password:

mariadb -uroot -e 'ALTER USER 'username'@'localhost' IDENTIFIED BY "HereYourPassword";FLUSH PRIVILEGES;'

That’s super weird there is one thing I don’t understand, I created a new DB, it worked

But in my config.php on my website there is my db username and password (which I use to get all my products informations) if I change the password for a random one, products are not here anymore, If I put back the password, they are here again

I also have that for all my wordpress with wp-config.php I can’t use the password in my wp-config.php, otherwise it says access denied

Okay I ran:

mariadb -uroot -e 'ALTER USER 'username'@'localhost' IDENTIFIED BY "HereYourPassword";FLUSH PRIVILEGES;'

I wrote the same exact password I have in my config.php and the one I’m using, but still access denied haha

Are you sure you are using the right username? Can’t you access from command line too? Could you please share the actual username you are using?

Yes it was working well before, and I’m just doing a copy/paste of what there is in my config.php on my website which works well

I’m using hhheeestiiaaar_usernameoggivia (php my admin and command line doesn’t work even if I change the password) I’ll try with a simpler one maybe

EDIT: Oh okaaayy with just HereYourPassword it worked on command line AND php my admin so it seems my password was too complicated (though I used the auto generate password)

I can tellit since I’m not using it anymore: q/Faqc#jW7^!ax9n

That’s strange, I’ve tested it in a wordpress site and it works pretty fine:

❯ grep DB_ wp-config.php
define( 'DB_NAME', 'master_66934' );
define( 'DB_USER', 'master_66934' );
define( 'DB_PASSWORD', 'q/Faqc#jW7^!ax9n' );
define( 'DB_HOST', 'localhost' );
define( 'DB_CHARSET', 'utf8mb4' );
define( 'DB_COLLATE', '' );
❯ mariadb -uroot -e 'ALTER USER 'master_66934'@'localhost' IDENTIFIED BY "q/Faqc#jW7^!ax9n";FLUSH PRIVILEGES;'

❯ mariadb -umaster_66934 -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10467
Server version: 11.4.7-MariaDB-deb12-log mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

Interesting, I don’t know what happened then xD

(anyway you helped me a lot, and I’m very grateful)

1 Like