I just started using Drupal last month and was buzzing along when my computer got a virus. I backed up my Drupal site (with modules) and the database no problem.

Today, I attempted to re-install the project onto WAMPserver and ran into a problem.

1) I drop the project into the www file. OK. Go to PHPMYADMIN to install the backed-up database and get the following error message.

Error

SQL query:

--
-- Database: `databasename`
--
-- --------------------------------------------------------
--
-- Table structure for table `access`
--
DROP TABLE IF EXISTS `access` ;

MySQL said: Documentation
#1046 - No database selected

2) WORKAROUND__ I create a new database in PHPMYADMIN called the same thing as the original database but I delete all tables. Open the old database.sql file in Notepad++. Delete the header. Copy the remainder of the table info. Go to SQL tab on PHPMYADMIN and paste the table info into the "Run SQL Query" section. Click Go.

This works to get my site viewable in Firefox at the LOCALHOST address. The problem here is that I'm not able to sign in under any one my usernames. All I get when I click on links is a 404 error. "Not Found: The requested URL /sitename/node was not found on this server."

I'm using the same WAMP 2.0 versions that I used on the original install. Please help. I'm ready to pull my hair out.

Comments

davidhernandez’s picture

When importing the dump into another database you have to have the new database already created. That is why it said "No database selected." How much of the header did you delete?

jadragna’s picture

Will you please explain the steps of that? I'm a noob. As for your question, I tried a few different things. First I tried deleting above the first dotted line, for me line 21. Then I tried deleting above line 10, "SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";" Neither worked.

davidhernandez’s picture

Try these instructions - http://drupal.org/node/81995 - they spell it out pretty well.

jadragna’s picture

Thanks, that was helpful. I was able to import the database.sql using the method described in the link, however, the problem described in my original workaround persists. I can view the index page at LOCALHOST but I can't click on any links and I can't sign in under any usernames. I get this error:
Not Found

The requested URL /[sitename]/node/[nodenumber] was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

davidhernandez’s picture

Was your site setup to use clean URLs, but your new WAMP you have setup isn't configured for it? Check if "/sitename/?q=node/nodeid" works.

jadragna’s picture

Yes, it was set up for clean URLs originally. I'm not sure how to adjust WAMP to use clean URLs now, however. Please advise. When I go to "/sitename/?q=node/nodeid" I am able to view that particular node. The problem with links persists, though. I think this is on the right track.

davidhernandez’s picture

You should be able to log in as admin, but things like the user page will fail when logging in because of the path. Use the ?q= paths to get to the admin pages and turn clean urls off. The page should be ?q=admin/settings/clean-urls. If this is the problem, it will correct the bad links created by Drupal. It won't fix hard-coded ones you added yourself, but admin pages, users, etc, should be ok.

jadragna’s picture

That completely solved the problem. Thank you so much man. I really appreciate people like you taking the time to help. Would it be wise to just keep clean URLs disabled until uploading the full site to the actual server? I think that's what I'll be doing from now on.

davidhernandez’s picture

It is up to you. You can turn clean urls back on as long as you make sure your WAMP server is setup correctly first. The same goes for when you move the site. The place you put it needs to be setup correctly. It shouldn't be a big deal, but you will have this problem if it isn't setup ahead of time. If you aren't sure, turn it off before moving the site and then run the test in Drupal that is on the clean urls config screen.