Здравствуйте!
Суть такая, пытаюсь прикрутить полнотекстовый поиск к php и не получается:
error_reporting(E_ALL);ini_set("display_errors", 1);
$conn = new mysqli('localhost',null,null,null,3312);
$resource = $conn->query("SELECT * FROM `music` WHERE MATCH('sia') LIMIT 0,10");
if($resource->fetch_assoc()===true) while ($row = $resource->fetch_assoc()){
var_dump($row);
}
$resource->free_result();
Warning: mysqli::__construct(): (HY000/1045): Access denied for user ''@'localhost' (using password: NO) in /var/***/sphinx.php on line 5
Warning: mysqli::query(): Couldn't fetch mysqli in /var/***/sphinx.php on line 7
Fatal error: Uncaught Error: Call to a member function fetch_assoc() on null in /var/***/sphinx.php:9 Stack trace: #0 {main} thrown in /var/***/sphinx.php on line 9
Через консоль норм заходит без пароля:
root@bs:/# mysql -h 127.0.0.1 -P 3312
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 2.0.4-id64-release (r3135)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> select * from music where match ('sia');
Конфиг:
...
searchd{
workers = threads
compat_sphinxql_magics = 0
listen = 3312:mysql41
log = /var/log/sphinxsearch/searchd.log
query_log = /var/log/sphinxsearch/query.log
read_timeout = 5
max_children = 30
pid_file = /var/run/sphinxsearch/searchd.pid
max_matches = 1000
seamless_rotate = 1
preopen_indexes = 1
unlink_old = 1
binlog_path = /var/lib/sphinxsearch/data/
binlog_max_log_size = 12M
}
...
Подскажите, что я делаю не так?
З.Ы: Пробовал другие порты, так-же :с
З.З.Ы: если в конфиге и скрипте ставлю 127.0.0.1, то получается так-же