Rebuild index: SQLSTATE[HY000] [2002] - But MySQL up and running


#1

Hi all,

had to move owncloud 8.0 to another server, experienced some trouble regarding acessibility of files for some users, so I tried to rebuild index by:

php console.php files:scan --all

got error:

An unhandled exception has been thrown:
exception 'Doctrine\DBAL\DBALException' with message 'An exception occured in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known' in lib/private/db/connection.php:33

Regarding this point Manual says "If you’re using MySQL please start your database."

But both MySQL and Owncloud are running. Besides: Since it is a hosted system I cannot restart such services as MySQL, because I only have very limited console access.

php -m says:
...
mysql
PDO
pdo_mysql
pdo_sqlite
...

Got slightly different PHP-Versions for CLI and Web:
php -v: PHP 5.6.28-he.0
phpinfo: PHP Version 5.6.31-he.0
("he" possibly stands for the hoster "Host Europe")
Might that be the problem?

Any hints?
Kind regards
Thilo


#2

Maybe contact the support of your hoster? The php_network_getaddresses: getaddrinfo failed: Name or service not known doesn't look right and is probably some problem on your operating system / PHP setup.


#3

The Hoster adviced me to change to PHP7. Did so but error remains. Now CLI still has PHP5.6, web has PHP7 :frowning:

Moved the complete installation to one of my servers with root access, no problem here. So it must be a hoster-related issue.

Will try again...


#4

Host Europe said their SSH-Proxy denies Access to the MySQL-Server, which is remote and not localhost, when connecting from command line.
So now I need a script that establishes MySQL-Connection and then runs php occ...

Will try myself and search the Internet, any advice is greatly appreciated. :blush: