Page 1 of 1

Error establishing a database connection

Posted: Fri Jul 21, 2023 2:33 pm
by romanv
I migrate cpanel user to myvesta and client have this error on his site: Error establishing a database connection

Password is correct. I try to login in phpmyadmin via user and it's work. But site is down.
Check permissions in mysql and user have all privileges on his database.

Vesta host
Vesta version: 0.9.9-0-4
OS: Debian 11.7
DB: Mysql 8.0.33

Cpanel host
cpanel version: v86.0.40
OS: CentOS 6.10
DB: MariaDB 10.0.38

Migrate via cpanel backup and restor via v-import-cpanel-backup.

Re: Error establishing a database connection

Posted: Fri Jul 21, 2023 3:44 pm
by myVesta
maybe in wp-config.php, define for DB_HOST is not localhost ?

Re: Error establishing a database connection

Posted: Fri Jul 21, 2023 3:56 pm
by romanv
myVesta wrote: Fri Jul 21, 2023 3:44 pm maybe in wp-config.php, define for DB_HOST is not localhost ?
In wp-config.php set: define('DB_HOST', 'localhost');

Re: Error establishing a database connection

Posted: Fri Jul 21, 2023 4:01 pm
by myVesta
And with the DB username and password from wp-config.php, you can login with phpmyadmin?
I have no idea then... see if something comes up in Error log.

Re: Error establishing a database connection

Posted: Fri Jul 21, 2023 4:03 pm
by myVesta
By the way, PHP lower than 7.4 can't connect to mySQL 8.
What PHP version you set to that domain?

Re: Error establishing a database connection

Posted: Fri Jul 21, 2023 4:07 pm
by romanv
myVesta wrote: Fri Jul 21, 2023 4:03 pm By the way, PHP lower than 7.4 can't connect to mySQL 8.
What PHP version you set to that domain?
Client have php 5.6

Re: Error establishing a database connection

Posted: Fri Jul 21, 2023 4:12 pm
by romanv
How can i change mysql 8 to mariab without reinstall vesta on debian 11?

Re: Error establishing a database connection

Posted: Fri Jul 21, 2023 4:17 pm
by myVesta
Pretty hard... you need first to remove mysql8 totally, then to install mariadb as vst-installer-debian.sh would install it... then to rebuild all databases, and finally to import databases dump you made before deleting mysql8.