Database down to my Mac

I have taken over a site (not by choice) that was run by a friend of my Mother’s - who has died (from Cancer) and left a legacy site handwritten in PHP and run from a MySql database. The site provides the back end for her local branch of SSAFA of which she is Chairperson and she is concerned because her Caseworkers use it on a daily basis and wants to make sure that we can administrate it for the foreseeable future

What is the easiest way to get the database from the server down to my Mac so I can test any changes I make to the PHP running through MAMP

I know that I can Export from PHPMyAdmin but what is the best/easiest format to use and is it then simply a case of importing into PHPMyAdmin in MAMP or copy/pasting.

A step by step would be useful.

Once I have it locally then I will be happier dissecting its construction to make changes and update it -and no doubt be looking for more help.

TIA David


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

In PMA, click on the database, then on the Export tab while that database is listed. Choose SQL as the export format, set structure and data on, and accept the rest of the defaults.

Depending on the number of rows, you can usually get away with simply displaying the results on screen, copying, and pasting into the SQL field in your local copy of PMA.

If the database is large, or has a lot of different tables and internal relationships, then you may need to do one of two other things.

For really complex setups, I usually back up and un-check data from the Export tab, and simply export the structure. Run that SQL on your local server first, and that will establish all the tables. Then go back and export the data one table at a time as a text file, then use PMA’s import from text file feature to load it.

For moderately complex databases, I do the structure and then all the data from all tables, in two passes.

Make sure that the versions of PMA are relatively the same, or if one is much newer than the other, that you have set the export to its most compatible setting. There are lots of settings on the export tab, and you can learn a lot by trying things and seeing if they blow up. If the results don’t match, simply drop the table and try again with different export settings.

Walter


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks Walter

I will give that a go and report back.

One other question - there is an Information_schema as well as the db

Do I need to export/import that as well?

D


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

No, that’s just something that PMA uses to generate graphs of your
data structure and to do other tricks.

Walter

On Nov 11, 2009, at 6:40 PM, DeltaDave wrote:

Thanks Walter

I will give that a go and report back.

One other question - there is an Information_schema as well as the db

Do I need to export/import that as well?

D


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

OK I have the DB installed on My Mac and MAMP is fine but I cannot connect to the database from the php pages - at least I am not getting through the log in.

How can I change the settings in MAMP to show PHP errors?

This is the php that doesn’t seem to be working.

<?
$DBName="earlpa11_funds";
$Link = mysql_connect ('localhost', 'root', 'root') or die("
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; There are problems with the server.&nbsp;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Please help by advising us of the date and time<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; you tried to access the website by e-mailing to<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:email@hidden">here</a> &nbsp; Thank you.");
?>

David


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Try adding these two lines to the top of your page, just after the opening <?php:

ini_set('display_errors',1);
error_reporting(E_ALL);

With those in place, it will complain about any and every thing that could be wrong.

Are you sure that your database has a password set for the root user? That’s not true by default. Try logging in to the database using the Terminal and see if you get anywhere with those credentials.

Walter


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walter

Thought I had posted here earlier - must have been dreaming coz its not here!

Anyway not sure my emails are getting to you - check your spam box please.

David


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options