Forums Register Login Forgot your login/password? Search
Common forum | 1 | 2 | 3 | 4 | 5 | ... | 453 | 454 | 455 | 456 | next »» | Create new thread
|
karthik
Name: karthik R |
2012-07-24 09:14:41
| reply! I have tried with sample example thru Sphinx Ql source code. Still i am getting "No Data Base Selected" error. Can anyone share the sample Example? it will be very useful for me.. Please |
|
karthik
Name: karthik R |
to: karthik, 2012-07-24 09:19:52
| reply! I have tried with sample example thru Sphinx Ql source code. Still i am getting "No Data Base Selected" error. Can anyone share the sample Example? it will be very useful for me.. Please using following Querys: $option['host'] = 'localhost'; $classApi = new SphinxQL($option); $value = $classApi->exec(" select count(DISTINCT ID) from tablename where fanme=2769457"); ERROR : No Database Selected |
|
barryhunter
Name: Barry Hunter |
to: karthik, 2012-07-24 15:13:27
| reply! > ERROR : No Database Selected Sphinx will never issue that error - it doesnt have the concept of databases. Just tables (which are really indexes). Two possible causes can think of, 1) you are not actully connnecting to sphinx, and have really connected to a mysql server. Maybe your client libary assumes the mysql port, or even (like in the case of the CLI client - it uses the socket if it can - and ignores the port number specificed, in that case have to specifically tell it to use tcp and ignore the socket) - maybe your client is doing something similar 2) Its actully an error generated by the client library, it expects you connect to a specific database, and shows that error when you dont. Look to disable that behaviour in the client code. |
|
karthik
Name: karthik R |
to: barryhunter, 2012-07-24 15:24:55
| reply! Thanks for suggestion. I have connected mysql port 9306 only . Can u tell , how to remove that checkings from my client libary ? Here i have mention mysql related CLI things ,those thinngs i have get it from phpinfo(); mysql MySQL Support enabled Active Persistent Links 0 Active Links 0 Client API version 5.1.35 MYSQL_MODULE_TYPE external MYSQL_SOCKET /var/lib/mysql/mysql.sock MYSQL_INCLUDE -I/usr/include/mysql MYSQL_LIBS -L/usr/lib64 -lmysqlclient_r > > ERROR : No Database Selected > > Sphinx will never issue that error - it doesnt have the concept of databases. Just tables > (which are really indexes). > > Two possible causes can think of, > > 1) you are not actully connnecting to sphinx, and have really connected to a mysql > server. Maybe your client libary assumes the mysql port, or even (like in the case of the > CLI client - it uses the socket if it can - and ignores the port number specificed, in > that case have to specifically tell it to use tcp and ignore the socket) - maybe your > client is doing something similar > > 2) Its actully an error generated by the client library, it expects you connect to a > specific database, and shows that error when you dont. Look to disable that behaviour in > the client code. > > |
|
barryhunter
Name: Barry Hunter |
to: karthik, 2012-07-24 15:43:25
| reply! > Thanks for suggestion. > > I have connected mysql port 9306 only . Can u tell , how to remove that checkings from my > client libary ? Well would say no, because we dont know what client library you using! But then found you have posted on SO too http://stackoverflow.com/questions/11627033/sphinxql-rt-index-error So it appears to be using the basic mysql client http://www.php.net/manual/en/intro.mysql.php I think there is logic error on line 34. Its using 'extract' incorrectly. It trying to extract the 'connection' member of the db_config array - there is no such member. host and port are just direct members of the array. Extract should be working directly on the array. There are other errors in the code too. line 21 is wrong. IN fact the whole __Config function seems odd, but should work if line 21 is fixed. And of course the last three functions in the code are completely bogus. They wont work - they seems to be copied over as is from the sphinxapi code, but will be completely non functional. ... if you fix the code, it should then actully try connecting to sphinx, rather than just using the default - which appears to be mysql in your case. > > Here i have mention mysql related CLI things ,those thinngs i have get it from phpinfo(); CLI is "Command Line Interface" - so refering to the actual mysql client binary, you run on the command line (proabbly via SSH if you not sitting at the machine) If you can try $ mysql -P9306 --protocol TCP to see if you definitly connect to sphinx - the version string should give it away |
Common forum | 1 | 2 | 3 | 4 | 5 | ... | 453 | 454 | 455 | 456 | next »» | Create new thread