Добрый день. Не пойму, откуда берется ошибка: Код (Text): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''string')' at line 1 The SQL being executed was: SELECT * FROM idx_news_content WHERE MATCH('string') Запрос: Код (Text): $sql = "SELECT * FROM idx_news_content WHERE MATCH('$keyword')"; $data = Yii::$app->sphinx->createCommand($sql)->queryAll();
По-моему, сфинкс любит двойные кавычки. Законектись с сфинксом в консоли и попробуй разные виды Код (Text): mysql -P9306 --protocol=tcp
Попробовал подключиться, пишет: Код (Text): ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (111)
Ну посмотри, на каком у тебя порту сфинкс висит, я же не знаю, может ты на другой повесил. Если тебе дали команду на форуме, можно же в документации посмотреть, что какой параметр означает?
На этом порту, в настройках: Код (Text): listen = localhost:9306:mysql41 Вот как получилось подключиться: Код (Text): mysql -P 9306 -h localhost Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 11 Server version: 5.7.24 MySQL Community Server (GPL) Copyright (c) 2000, 2018, 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> Ошибку выдает: Код (Text): mysql> SELECT * FROM idx_news_content WHERE MATCH('asperiores'); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''asperiores')' at line 1 mysql> SELECT * FROM idx_news_content WHERE MATCH("asperiores"); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"asperiores")' at line 1