I recently changed web host where my remote SQL db is located for Matomo (from Hostgator to Hostinger). The Matomo installation has remained in the same place, in ‘stats’ subdirectory, in a subfolder, on my domain. I exported the contents of the db before shutting down my Hostgator account, created a new db at Hostinger, and imported the data, set up the relevant user and password and access levels, and edited the config.ini.php file on my Matomo installation to reflect the new db location and log in details, but the error message I get when starting Matomo index.php file is:
An error occurred. Cannot connect to the database:
SQLSTATE  Access denied for user ‘u99999999_user’@‘81.x.x.x’ (using password: YES)
I have set up the remote db to accept logins from any host, to eliminate that possible error as the IP address in the Matomo log in error page had the last block of numbers changing every time I tried. I have changed the db password several times to varying lengths etc. (as Hostinger had some issues with this elsewhere with no forewarning!) and mirroring this in the config.ini.php file. Hostinger have advised me that the defaul port for accessing their SQL server is 3306, which as I understand is the default port used by Matomo. I tried including the port number in the config.ini.php file but it didn’t make any difference.
The start of the config.ini.php file with a few security edits is this:
; <?php exit; ?> DO NOT REMOVE THIS LINE ; file automatically generated or modified by Matomo; you can manually override the default values in global.ini.php by redefining them in this file. [database] host = "185.28.20.x" username = "99999999_user" password = "password" dbname = "88888888_domain" tables_prefix = "piwik_" [General] proxy_client_headers = "HTTP_X_FORWARDED_FOR" proxy_host_headers = "HTTP_X_FORWARDED_HOST" salt = "edit123blablabla" trusted_hosts = "stats.domain.co.uk" trusted_hosts = "www.domain.co.uk"
Is there any point trying to completely reinstall Matomo and letting the app web interface set up the MySQL db connection rather than just doing it from the config file? Any ideas where I might potentially be going wrong please? TIA.