S
S
Sergey2015-04-09 20:39:56
Sphinx
Sergey, 2015-04-09 20:39:56

Where do I get error while working with yii2-sphinx?

I use this solution:
https://github.com/yiisoft/yii2-sphinx/
Installed via composer, everything is ok.
In the config it is:

'sphinx' => [
            'class' => 'yii\sphinx\Connection',
            'dsn' => 'mysql:host=127.0.0.1;port=9306;',
            'username' => '',
            'password' => '',
        ],

In the sphinxserach config, the port for working with mysql is running:
searchd
{
  listen			= 9312
  listen			= 9306:mysql41
  log			= /var/log/sphinx/searchd.log
  query_log		= /var/log/sphinx/query.log
  read_timeout		= 5
  max_children		= 30
  pid_file		= /var/run/sphinx/searchd.pid
  max_matches		= 1000
  seamless_rotate		= 1
  preopen_indexes		= 1
  unlink_old		= 1
  workers			= threads # for RT to work
  binlog_path		= /var/lib/sphinx/
}

Why when calling the code from the documentation:
use yii\sphinx\Query;

$query = new Query;
$rows = $query->select('id, price')
    ->from('idx_item')
    ->andWhere(['group_id' => 1])
    ->all();

i see an error:
Database Exception - yii\db\Exception
SQLSTATE[HY000] [2002] Connection refused

? How to solve the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-04-09
@butteff

Reloaded search.d and started. Apparently, while the config rules, he made something, but did not reboot.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question