sphinxsearch icon indicating copy to clipboard operation
sphinxsearch copied to clipboard

Database connection parameters

Open CarlosGarcell opened this issue 9 years ago • 1 comments

Why is it that the DB name and password are left blank on the mysqli connection function call, instead of them being set as blank on the config file? This would make changing the DB connection parameters a lot easier

CarlosGarcell avatar Oct 12 '16 20:10 CarlosGarcell

I'm having the same issue. I found that when I update line 26 to this:

$this->_raw_mysql_connection = mysqli_connect(
\Config::get('sphinxsearch.mysql_server.host'), 
\Config::get('sphinxsearch.mysql_server.username'), 
\Config::get('sphinxsearch.mysql_server.passwd'), 
\Config::get('sphinxsearch.mysql_server.dbname'), 
\Config::get('sphinxsearch.mysql_server.port'));

and added this to my config/sphinxsearch.php

    'mysql_server' => array(
        'host' => env('DB_HOST'),
        'port' => env('DB_PORT'),
        'username' => env('DB_USERNAME'),
        'dbname' => env('DB_DATABASE'),
        'passwd' => env('DB_PASSWORD'),
    )

it worked and I can query the model with relationships.

dingman avatar Nov 27 '17 03:11 dingman