sngrl / sphinxsearch

Sphinx Search for Laravel 5
MIT License
124 stars 89 forks source link

Database connection parameters #16

Open CarlosGarcell opened 8 years ago

CarlosGarcell commented 8 years ago

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

dingman commented 7 years ago

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.