Error: SQLSTATE[HY000] [2003] Can't connect to MySQL server on '127.0.0.1' (111) on database: sphinx
Hi J. Suto,
All is now installed without any errors, but when I borwse to my site I get this error. The database does indeed not exist. In the config.php I see the following entries:
$config['SPHINX_DRIVER'] = 'sphinx'; $config['SPHINX_DATABASE'] = 'sphinx'; $config['SPHINX_HOSTNAME'] = '127.0.0.1:9306'; $config['SPHINX_MAIN_INDEX'] = 'main1'; $config['SPHINX_TAG_INDEX'] = 'tag1'; $config['SPHINX_NOTE_INDEX'] = 'note1';
Are these entries used and if yes, what do I need to change them to?
Thanks!
RTop.
Comments (18)
-
repo owner -
reporter Indeed, sorry, searchd wasn't running, would have sweared it did. Sorry again. You can close this as well! Grtz, RTop
-
repo owner - changed status to resolved
OK
-
i am facing same issue
-
repo owner Then use the same resolution.
-
Hi jsuto,
I faced the same issue but in my case searchd wasn't started and no problem in starting rc.piler. so got the same MySQL error. on analyzing i came to know /var/run/piler/search.pid was not updated with id thus caused the issue to resolve I just passed the command
searchd --stop
and restarted the service. it works fine now..!! -
repo owner Great news!
-
Hi Janos, im facing the same issue and i couldn't able to fix this.
Error: SQLSTATE[HY000] [2003] Can't connect to MySQL server on '127.0.0.1' (111 "Connection refused") on database: sphinx
it happen after the linux updates.
-
repo owner Hello Jahir. Please start the searchd daemon, make sure it's listening on port 9306, and the web server user (perhaps www-data) can access it.
-
hello Janos, Thanks for your reply. i have changed the listening port 9306. pls find the attached screen shot. is this correct ? also pls let me know how to start searchd daemon. im not familiar in linux.
-
repo owner Yes, it seems to be fine. To start searchd, locate and use rc.searchd. It should be right next to rc.piler.
-
Thanks for your reply. can you help me what i have to add in here to start ?
-
Hi Janos, still the issue remains.
Error: SQLSTATE[HY000] [2003] Can't connect to MySQL server on '127.0.0.1' (111 "Connection refused") on database: sphinx
-
repo owner Is searchd running? Can you access it by the following command?
mysql -h 127.0.0.1 -P9306
Is there any security layer blocking the web server accessing it? (most notably selinux)
-
hi janos, tried the command same issue. i have checked SELINX not active.
-
repo owner Please pay more attention to my questions:
Is searchd running?
-
shows,
-
repo owner Remove the following from sphinx.conf:
listen = 127.0.0.1:9306
Then try starting it again. I didn't spot the error in your config.
- Log in to comment
It's definitely used. Please check if searchd is running, and listening on port 9306