I'm currently developing a Project which uses MAMP, phpMyAdmin and such. I will need to deliver the materials and instructions to my teachers so they can "duplicate" the server and run on their machines.
I know about the folder htdocs which contains my scripts but I have no idea where the database I created with all the columns and rows is located.
Besides htdocs, what files do I need to send to my teachers so they can replicate my localhost server exactly as it is now.
Thanks in advance!
This depends on your familiarity and skill level. I would certainly avoid trying to copy the MySQL file data across - it's not really designed for that purpose.
Essentially, the best option is to create a .sql
file dump of the database. As you're using a "stack", it doesn't sound likely you'd be using a linux console (for mysqldump
), so your options are:
a) Use a PHP script
You could set up and execute a PHP script that will do the above.
$database = 'db';
$user = 'user';
$pass = 'pass';
$host = 'localhost';
$dir = dirname(__FILE__) . '/myDB.sql';
echo "Dumping DB to {$dir}";
exec("mysqldump --user={$user} --password={$pass} --host={$host} {$database} --result-file={$dir} 2>&1");
b) Use a DB GUI
Using something like HeidiSQL, you can connect to your DB and then 'Export' it using the Table tools ('Export database as SQL'), e.g.
You could then use the resulting .sql
file from either scenario to populate the other user's MySQL databases - depending on the size, phpMyAdmin should be able to handle it.