I installed Drupal6.2 in public_html/drupal/ and the installation went ok, I can access it without problems.

Now I'm trying to get it to work as a multisite on one of my subdomains but during the installation I get this (twice):

user warning: 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 ') ORDER BY fit DESC LIMIT 0, 1' at line 1 query: SELECT * FROM menu_router WHERE path IN () ORDER BY fit DESC LIMIT 0, 1 in /home/prkos/public_html/drupal/includes/menu.inc on line 315.

Is this an installation issue or maybe I set up the subdomain badly?

Comments

flevour’s picture

Hi portulaca,
may you list the precise steps, directory structure and action you took to get this error?
Cheers,
flevour
---------------------------
http://flevour.net

waztech_steve’s picture

this is solved in the post farther below by Portulaca, I just wanted to bump it up higher in the list. wish we could push some comments up the tree to highilght the working fixes and save others time...

this is caused by an incorrect value in the settings.php file for the subdomain for the parameter $cookie_domain
if you start the install script with that value, you need to perform some steps to reset some things and start over.

in the settings.php file for the subdomain... /sites/subdomain/settings.php
find the parameter $cookie_domain
change that to match the name of your website in your browsers address bar, i.e. http://drupalsite2.com - use drupalsite2.com as the value
save the file
clear the cookies for this site in your browser
drop the tables from the database for this new site.
close the browser
reopen browser and restart the install.php script

that should get you through the install... good luck

portulaca’s picture

I installed Drupal6.2 through Fantastico in drupal/ folder on my main domain. I can access it through mymaindomain.com/drupal/ and it all seems to be working ok.

I have an addon domain set up on that hosting account (addon domains are set up as subdomains on my hosting account) and I want it to use the already installed drupal. Here are the steps I made:

  • created a new MySQL database and a new user with all permissions
  • added subdomain.com folder in drupal/sites/
  • copied settings.php from default/ into subdomain.com folder and changed database and baseurl to subdomain info
  • deleted the subdomain (addon domain) folder
  • changed drupal/ folder permissions to 777
  • used .php script to create symlink (symlink("./drupal/", "subdomain");)
  • went to subdomain.com/install.php and chose English as install language
  • # Choose language, # Verify requirements, # Set up database went ok with a green tick next to them, it stopped at #Install site with the above SQL syntax error message
flevour’s picture

I am not sure about what's wrong here. By the way I know installations through Fantastico are usually discouraged by member of the community for a variety of reasons.
Anyway, if the other main domain is running ok, I'd exclude some file corruption occurred. At this point I've got no idea how to help, hope someone else hops in and can fix your problem.
Cheers,
flevour
---------------------------
http://flevour.net

portulaca’s picture

Thanx for the reply, I always used to install Drupal manually before because there were always problems if I went through Fantastico, I was surprised when 6.2 worked and it was very quick, not to mention the save on bandwidth. I hope Fantastico isn't the cause of the problem here, but as you said if the first site works ok it shouldn't be.

I've read on another thread with similar symptoms that it has to do with shared tables in the databases, I made a separate database for my second drupal site but maybe its a general db table problem.

mauror’s picture

I just don't know whether it could work for you or not but you can look here: http://drupal.org/node/223160#comment-776257 and here http://drupal.org/node/235675#comment-841413.
I found them by doing: http://www.google.com/search?hl=en&q=ORDER+BY+fit+DESC+LIMIT+0%2C+1%27+a...

Update: looks like it might be a cookie and/or javascript relate problem (http://drupal.org/node/210752#comment-725736 and http://drupal.org/node/1213). Try deleting cookies and enabling javascript for the installation...

portulaca’s picture

thank you for those links, I found a mention of dropping tables so I tried it and the installation went through, Im now happily configuring my second site (addon) :D

for everyone else heres what I did

  • checked if javascript is enabled in my browser (it always is)
  • cleared all the cookies (you can probably get away with deleting only the ones for your site)
  • went to PhpMyAdmin on my host, selected my addon's site database, I could see 40-something tables listed
  • select all the tables (there is a Select All link down at the bottom)
  • select Drop from the box, this will delete all the tables
  • went to mySecondSite.com/install.php (English) and the installation finished through without errors :D
Frico’s picture

This solved it for me as well.... Tried to find the answer for a whole day...
thanks

SolaFide001’s picture

Tried enabling JavaScript (it was already enabled), deleted all cookies, dropped all tables, created new prefix for the tables, tried again, same error (line 315).

It seems ever clearer that this is a bug in the php scripting somewhere that causes a malformed SELECT statement when the IF statement doesn't produce the expected results.

tilespace’s picture

If there is anyone that comes across this and is having the same problems, here is a potential fix.

This is assuming you are trying to do a multi-site setup and have $cookie_domain = 'somedomain.com'; uncommented in your settings.php and the value is the same as any of the other sites (maintaining logged in state across them), comment that line out or make the value unique and it will install with no errors (other than the 'table already exists' errors obviously).

Now the funny part is, with 3 sites up and running already in a multi-site setup, this didn't happen until I went to install the 4th one 2 weeks after the other ones were done and populated with content. This didn't happen when I installed the other 3 at the same time.

So now I have 3 sites that share logged in/out state and 1 that doesn't... Crap.

MountainX’s picture

Thank you!!!

TimG1’s picture

OYE! I spent 3 days trying every solution I could find after googling and scouring these forums. None of them worked for me. My 1st site uses many modules. It turned out that this is too many for the install to handle. Here's my configuration...

/sites/all/modules (40 modules in here)
/sites/all/themes

/example.com/files
/example.com/settings.php

/example.com.secondSite/files
/example.com.secondSite/settings.php

I have a symlink in Drupal root for example.com/secondSite.

example.com/secondSite uses a separate DB from example.com

My memory_limit is set to 128M.

S O L U T I O N
I just took my first site, example.com offline. Then I renamed /sites/all/modules to /sites/all/_modules I then went to www.example.com/secondSite/install.php and it worked! No errors! I then went back renamed _modules back to modules and then brought my first site back online. Everything seems to be working great!

This might also work if you increase your memory_limit but I don't have direct access to that in my case, so this did the trick.

I'm so happy this is working now. =)

-Tim

roball’s picture

This is really a nasty Drupal bug that still exists in version 6.15. On one of the servers I am maintaing I had to add a third domain to a Drupal multisite installation. I tried to increase PHP's memory_limit to even 512M, temporarily renamed the "all" directory, but still have no luck. After the "Set up database" installation step, the following error message appears twice:

user warning: 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 ') ORDER BY fit DESC LIMIT 0, 1' at line 1 query: SELECT * FROM menu_router WHERE path IN () ORDER BY fit DESC LIMIT 0, 1 in /usr/share/drupal/includes/menu.inc on line 315.

I was not yet able to fix this problem, unfortunately.

-- Robert

marcocuyt’s picture

Having read a million threads that were not able to solve my problem (apparently very common practice in Drupal world), I have found the solution for my situation.
I'm starting to believe that there are a couple of variations of problems that can cause the same error message

In my case, it was a server configuration error and the hosting company has helped me by putting a php.ini in my public_html folder with 1 sentence: "session.save_handler = user"
That's all...everything worked fine with that single action

n43406w79378’s picture

In my case I use Firefox and the NoScript v1.10 and the Cookie Monster v1.0.2 Add-ons. After the error, I (1) dropped my tables, (2) Allowed cookies and scripts and the problem solved.