Guest Posted February 16, 2005 Share Posted February 16, 2005 I am migrating Oscommerce to a new server and I copied all the files and database to the new server. I changed the config files to point to the new server and now I am getting this error" Warning: mysql_query(): No database selected in /home/osc/catalog/includes/functions/database.php on line 45 1046 - No database selected select configuration_key as cfgKey, configuration_value as cfgValue from configuration [TEP STOP] I tried to set the $database variable to the osc database but nothing happened, still the same error! Any ideas would be highly appreciated! Thanks Link to comment Share on other sites More sharing options...
ozcsys Posted February 16, 2005 Share Posted February 16, 2005 I am migrating Oscommerce to a new server and I copied all the files and database to the new server. I changed the config files to point to the new server and now I am getting this error" Warning: mysql_query(): No database selected in /home/osc/catalog/includes/functions/database.php on line 45 1046 - No database selected select configuration_key as cfgKey, configuration_value as cfgValue from configuration [TEP STOP] I tried to set the $database variable to the osc database but nothing happened, still the same error! Any ideas would be highly appreciated! Thanks <{POST_SNAPBACK}> If you have changed the database info in your configure.php files to match your new database info check a couple of things. 1. A lot of servers use a username_databasename setup. Look at your database from your hosting control panel and see how the database and user are listed. If they are listed this way then you have to enter them in that way in your configure.php files 2. Make sure you have assigned your user to your database. It is a three step process, create database, create user, assign user to database. if you leave out step three you will get that error also. The Knowledge Base is a wonderful thing. Do you have a problem? Have you checked out Common Problems? There are many very useful osC Contributions Are you having trouble with a installed contribution? Have you checked out the support thread found Here BACKUP BACKUP BACKUP!!! You did backup, right?? Link to comment Share on other sites More sharing options...
Guest Posted February 16, 2005 Share Posted February 16, 2005 I can connect to the Db server ok. Would it be caused by a missing file??? I am uploading my files again just to make sure its not a missing file. Any other ideas on what I can check to make this work? Link to comment Share on other sites More sharing options...
ozcsys Posted February 16, 2005 Share Posted February 16, 2005 I can connect to the Db server ok. Would it be caused by a missing file??? I am uploading my files again just to make sure its not a missing file. Any other ideas on what I can check to make this work? <{POST_SNAPBACK}> If you are getting the 1046 error then osC is not connecting to the database. This is caused by the database info in your configure.php not being correct or as I mentioned in my above post because the user has not been assigned to the database. The Knowledge Base is a wonderful thing. Do you have a problem? Have you checked out Common Problems? There are many very useful osC Contributions Are you having trouble with a installed contribution? Have you checked out the support thread found Here BACKUP BACKUP BACKUP!!! You did backup, right?? Link to comment Share on other sites More sharing options...
Guest Posted February 17, 2005 Share Posted February 17, 2005 I had misspelled the database name in the configure.php. It working now If you are getting the 1046 error then osC is not connecting to the database. This is caused by the database info in your configure.php not being correct or as I mentioned in my above post because the user has not been assigned to the database. <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.