This appears to be the same error as reported in bug #243458 in Drupal 6.1
I'm marking this critical since it's pretty much a show stopper for installing Drupal
The following error shows up after the "Set up database" step of the install:
* 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 /sites/drupal/drupal-6.13/includes/menu.inc on line 315.
* 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 /sites/drupal/drupal-6.13/includes/menu.inc on line 315.
I'm running this with drupal-6.13, php-5.2.10, httpd-2.2.13 and mysql 4.1.10 on Mac OS X Tiger.
Looks like at this point all the tables are created in the database:
mysql> show tables;
+-------------------------+
| Tables_in_drupal |
+-------------------------+
| access |
| actions |
| actions_aid |
| authmap |
| batch |
| blocks |
| blocks_roles |
| boxes |
| cache |
| cache_block |
| cache_filter |
| cache_form |
| cache_menu |
| cache_page |
| comments |
| files |
| filter_formats |
| filters |
| flood |
| history |
| menu_links |
| menu_router |
| node |
| node_access |
| node_comment_statistics |
| node_counter |
| node_revisions |
| node_type |
| permission |
| role |
| sessions |
| system |
| term_data |
| term_hierarchy |
| term_node |
| term_relation |
| term_synonym |
| url_alias |
| users |
| users_roles |
| variable |
| vocabulary |
| vocabulary_node_types |
+-------------------------+
43 rows in set (0.00 sec)
Restarting the install by going back to the /index.php does not fix this.
Comments
Comment #1
abebak commentedComment #2
h3000 commentedI'm having this problem as well.
However only when using a different theme. I have another theme installed, and it works fine. However, when using this new theme - a custom theme - zen subtheme.
I just performed the procedure to make a subtheme based on the official documentation. On a new site, the new theme works and does not produce this error. However, on an old site, with lots of blocks installed, the error comes up when viewing the block page.
Has anyone found a solution to this?
my setup is
Drupal 6.13
PHP 5
Apache 2
thanks
Comment #3
h3000 commentedchanged title back to OP
Comment #4
tmacy commentedI found a workaround or fix that works in my environment. Here are the conditions that seem to contribute to this issue in my environment:
1. Proxied web servers cause cookies to be problematic. I must always specify the $cookie_domain in settings.php.
2. Have multiple instances of Drupal running in directory hierarchies well below web server document root. I must always specify the $base_url.
Problem: Fresh installs of Drupal v6.x fail with the above (menu_router SQL error).
Fix:
1. (Optional: Make a backup copy of default.settings.php.) Edit default.setttings.php to modify only the $cookie_domain and $base_url to site specific values.
2. If the installation failed previously, delete all of the tables that were created in the DB. May not be required, but I do it.
3. Depending on which version of v6.x you are installing, you may need to create settings.php by copying 'default.settings.php'. This is true in v6.14 but NOT in some prior versions - that's where INSTALL.txt helps - where Drupal makes a copy.
4. Clear any old cookies for your site from your browser.
5. Reinstall by pointing your browser to your site.
Wasted the better part of day trying to find this and hope it helps you if you into this issue.
Comment #5
cforsy commentedI'd been developing a site on my old IBM Thinkpad running Linux/Lamp. Drupal installed flawlessly on this old system with no errors whatsoever. But being an old laptop it was soooo sloooow so I thought it would be just as easy to set it up on my Mac running MAMP on OSX 10.4. But boy was I wrong! I kept getting the dreaded menu.inc line 315 error every time and when I tried to copy other site over, it worked except I could not log into admin so it was useless. Same errors from Safari, Opera, and Firefox.
I tried every single solution here and elsewhere I still could not get past the mysql syntax error, and if I did actually get the error to go away it would go blank on install site and do nothing. I changed the settings.php numerous ways as described in numerous posts but no go.
What DID finally worked for me was (in this order):
1. Dropped entire DB and created new one.
2. Set settings.php AND php.ini $cookie_domain to localhost:8888 (may be mac specific but on PC/Linux may be just localhost) this value was blank in php.ini and I did not un-comment $base_url in settings.php
3. Cleared private data in Firefox (3.5) and then just to be sure it cleared I went into preferences - Privacy - custom (from drop down menu) then Show Cookies. There were still a ton of cookies in there even though I just cleared private data, so I hit Remove All Cookies. Closed window and shut down FF.
4. Stopped Apache server and re-started
4. Opened FF and ran the install script and it went straight to install with progress bar and within 5 seconds it was installed.
Amazing. I'm not sure exactly what did it though I suspect it was a combination of #2 & #3. I even copied my other site over and can now log into admin! Woohoo! Hope this helps anyone trying this on MAMP.
Comment #6
Vinz commentedSame problem with 6.15...
Here is my environment :
FreeBSD-8.0
Apache-2.2.13
PHP-5.2.11
MySQL-5.0.86
JavaScript and Cookies are enabled in Firefox (3.5.8). I think I tried all the solutions found in other posts, but it does not work !
Comment #7
dxvargas commentedTry to empty the database. Worked with me! (found solution here:http://programmingbulls.com/drupal-aggregator/menu-inc-line-315-install-...)
Comment #8
dpearcefl commentedIs this issue still occurring in the current version of Drupal v6?
Comment #9
damien tournoud commentedThere are plenty of duplicate issues of this. The most common cause is cookies not working properly.