| Author |
Message |
cbradley
MD user level 5


Joined: July 21, 2005
Posts: 59
Member
|
 Posted:
Sep 20, 2005 - 11:03 AM |
|
| Post subject: Restoring MySQL database |
Hi
Can anyone tell me where I can find a real idiot's step-by-step guide to restoring my database from a .sql file saved using the MySQL utility in MD-Pro, and/or to transfer the saved data to a new database? Hardly needs saying, but this is new territory for me.
I saved the db before upgrading to 1.0.74 but something went wrong so I restored the full previous version. I now get a 'session initalisation failed' message. I tried to reset the session table using mdsos, but that tells me there is a syntax error in MySQL.
I did manage to install a full version of 1.0.74 to a new db, so an alternative would be to transfer the old tables to the new database. I just don't know how to do that without editing each one manually with phpMyAdmin - and I have other plans for the rest of my life.
Chris |
|
|
|
 |
PeteBest
MD user level 5


Joined: Oct 06, 2003
Posts: 4845
bannato
|
 Posted:
Sep 20, 2005 - 11:17 AM |
|
|
'session initalisation failed' can mean you've got the wrong database details, or your database is empty.
To restore a backup made from MySQL_Tools follow these steps.
Open phpmyadmin and select your database
Follow the sql link from the tab in the main frame
Browse to the location of the file on your HDD and hit go
That's it. The .sql file drops the existing tabes, but if you want to you could remove them yourself. After that you'll need to edit \config\md-config.php with your database details if you're moving to another host/database |
_________________ Retired from official MAXdev duties |
|
|
 |
cbradley
MD user level 5


Joined: July 21, 2005
Posts: 59
bannato
|
 Posted:
Sep 20, 2005 - 11:43 AM |
|
|
Thanks Pete, a huge step forward in knowledge for me.
The old installation still won't work even having checked md-config.php agaisnt the saved version, but at least I know now I can install the latest release with a new db and transfer the data.
Great support. |
|
|
|
 |
alex-19841
MD user level 2


Joined: Dec 29, 2005
Posts: 25
bannato
|
 Posted:
Dec 29, 2005 - 11:39 AM |
|
|
After restoring SQL, would it restore all posts? |
|
|
|
 |
PeteBest
MD user level 5


Joined: Oct 06, 2003
Posts: 4845
bannato
|
 Posted:
Dec 29, 2005 - 11:46 AM |
|
|
| alex-19841 wrote: |
| After restoring SQL, would it restore all posts? |
Not quite sure on your meaning of posts, but yes all your content on your site is stored in the database |
_________________ Retired from official MAXdev duties |
|
|
 |
sjrw
MD user level 2


Joined: Apr 14, 2006
Posts: 23
bannato
|
 Posted:
July 06, 2007 - 06:48 PM |
|
|
I just followed these instructions - used phpmyadmin to restore the backup sql file - and now it wont work at all.
http://www.sunflowertherapies.net
help
heres what it said
Error
SQL query:
CREATE TABLE `sun__blocks` (
pn_bid int( 11 ) unsigned NOT NULL AUTO_INCREMENT ,
pn_bkey varchar( 255 ) NOT NULL ,
pn_title varchar( 255 ) NOT NULL ,
pn_content text NOT NULL ,
pn_url varchar( 255 ) NOT NULL ,
pn_mid int( 11 ) unsigned DEFAULT '0' NOT NULL ,
pn_position varchar( 255 ) DEFAULT 'l' NOT NULL ,
pn_weight decimal( 10, 1 ) DEFAULT '0.0' NOT NULL ,
pn_active tinyint( 3 ) unsigned DEFAULT '1' NOT NULL ,
pn_refresh int( 11 ) unsigned DEFAULT '0' NOT NULL ,
pn_last_update timestamp DEFAULT 'CURRENT_TIMESTAMP',
pn_language varchar( 30 ) NOT NULL ,
allow_gids varchar( 255 ) DEFAULT 'A' NOT NULL ,
PRIMARY KEY ( pn_bid )
);
MySQL said:
#1067 - Invalid default value for 'pn_last_update' |
|
|
|
 |
sjrw
MD user level 2


Joined: Apr 14, 2006
Posts: 23
bannato
|
 Posted:
July 07, 2007 - 02:36 AM |
|
|
This is what happens when I try to access the site
Please help
Fatal error: Call to a member function on a non-object in C:\wamp\www\modules\AutoTheme\includes\md-pro\atAPI.php on line 238 |
|
|
|
 |
|
|