Forum
Error loading database to staging site preventing access to Perch Admin
I developed my site locally on MAMP with no problems. In this site, for the first time, I am including the Shop app PayPal (though it isn't fully set up yet). The site works well locally.
I followed the instructions for moving the site form local development to staging: sub domain created; sessions path created; A record added; database created, named, username and password created; compatibility test passed.
When I went to import the local database (saved in plain text) to the remote server I received the following error message from my host:
Table structure for table perch2_categories

--
CREATE TABLE perch2_categories
(
catID
int( 10 ) NOT NULL ,
setID
int( 10 ) unsigned NOT NULL ,
catParentID
int( 10 ) unsigned NOT NULL DEFAULT '0',
catTitle
char( 64 ) NOT NULL DEFAULT '',
catSlug
char( 64 ) NOT NULL DEFAULT '',
catPath
char( 255 ) NOT NULL DEFAULT '',
catDisplayPath
char( 255 ) NOT NULL DEFAULT '',
catOrder
int( 10 ) unsigned NOT NULL DEFAULT '0',
catTreePosition
char( 255 ) NOT NULL DEFAULT '000',
catDynamicFields
text NOT NULL
) ENGINE = MYISAM DEFAULT CHARSET = utf8;
MySQL said: 
1046 - No database selected
I noticed that my database was larger than the allowed import so I went back to the local, removing content and reducing the size of the database from approximately 10MB to 600KB. I again saved the database and attempted to import it into the remote server. I got the same error message.
Can you please help me decipher the error message so I can begin adding content on the staging site?
This might be helpful too. When I try to log into the remote Perch Admin I get this message at the top: "There's a problem with connecting to the database. Please check your settings." My settings in the config match the settings used in the compatibility test and I have created a user for the database on the remote site which matches both. The Perch debug message which appears is below.
Debug Message SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0 Invalid query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'hawaiianwarfare_db.perch2_settings' doesn't exist Queries: 0 Memory: 1.5564 Array ( [type] => 8192 [message] => Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater [file] => Unknown [line] => 0 )
Thanks for your help!
Kim
Have you selected a database to import into? From the message it sounds like you're connected but haven't picked a database to work with.
Yes. I named the database at the remote server in mysql. When signing in didn't work, I made a new user, rewrote the config file to reflect that, saved, uploaded it, and passed a new compatibility test. It still gave me the message that I (using the new user name) was having a problem connecting to the database and it wouldn't allow me to sign in.
If you are just having problems connecting to the database then you will need to speak to your host. There is a limited amount we can do in Perch support to help with hosting issues.
However if the compatibility test works then those details will allow you to connect to Perch and so there are some incorrect details being used somewhere.
So the Debug message and the message I initially received from the host don't help determine what those incorrect details are?
No, there are any number of reasons it could be. We don't have any knowledge of how your hosting is set up. Your host is the place to raise a ticket if you believe you can't make a database connection and you can't debug it yourself, as we would just be guessing.
OK. Thanks. Will pursue on this end...