yumico23 Posted April 19, 2006 Share Posted April 19, 2006 Hi,I have an Intranet application running on PHP and MySQL. It was written by another programmer and I can't seem to find the location of the MySQL Database.Is there PHP syntax that can detect the path directory to the MySQL database.Thank youYuli Quote Link to comment https://forums.phpfreaks.com/topic/7831-how-to-find-mysql-database-location-with-php/ Share on other sites More sharing options...
wisewood Posted April 19, 2006 Share Posted April 19, 2006 if you look through the php files for where the connection is made, this will give you information such as "localhost", "username", "password".Have you tried running [a href=\"http://your_server/phpmyadmin\" target=\"_blank\"]http://your_server/phpmyadmin[/a] ? Quote Link to comment https://forums.phpfreaks.com/topic/7831-how-to-find-mysql-database-location-with-php/#findComment-28531 Share on other sites More sharing options...
yumico23 Posted April 20, 2006 Author Share Posted April 20, 2006 [!--quoteo(post=366375:date=Apr 19 2006, 06:47 AM:name=wisewood)--][div class=\'quotetop\']QUOTE(wisewood @ Apr 19 2006, 06:47 AM) [snapback]366375[/snapback][/div][div class=\'quotemain\'][!--quotec--]if you look through the php files for where the connection is made, this will give you information such as "localhost", "username", "password".Have you tried running [a href=\"http://your_server/phpmyadmin\" target=\"_blank\"]http://your_server/phpmyadmin[/a] ?[/quote]=================================================================Hi Wisewood, Thanks a lot for your reply.Ya I have tried running it [a href=\"http://your_server/phpmyadmin\" target=\"_blank\"]http://your_server/phpmyadmin[/a] and there is only one empty database called "test".I even do a file search in the whole C Drive and Network but still could not locate it.The whole scripts of the application can be located but the MYSQL DB could not.Is there any way / method to locate it? maybe a php script or syntax which I can run at the connection file to detect the location of the database?Inside the connection files, the hosting is "localhost".Thank you for you advice Wisewood.Yuli Quote Link to comment https://forums.phpfreaks.com/topic/7831-how-to-find-mysql-database-location-with-php/#findComment-28838 Share on other sites More sharing options...
wisewood Posted April 20, 2006 Share Posted April 20, 2006 I just found this... which might help you.If you can find the data/ directory you might get lucky.[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Copying database filesWhen it comes to backing up MySQL databases, don't ignore the most obvious solution: making copies of the database files themselves.Because MySQL uses the same table format on different platforms, it's actually possible to copy MySQL table and index files from one platform and use them on another without any difficulties (assuming, of course, that you're using the same version of MySQL on both platforms).So which files should you copy? MySQL stores all its databases in a special data/ directory, which is further divided into subdirectories, one for each database. Tables and table indexes are represented as files, with the file name equal to the table name plus an extension. The easiest approach is to just copy the entire data/ directory to backup media, and archive it so that you can get it back at any time. You might want to write a script to automate the copy. You can then pop the script into your crontab so it can run on a daily or weekly basis, depending on how frequently your databases get updated.If you're moving files between Windows and UNIX platforms, there is one thing that can trip you up. UNIX file names are case-sensitive, while Windows names are not. Therefore, mixed-case MySQL table names are likely to get corrupted when moved between Windows and UNIX (though the data in the tables will be fine). If your SQL code uses these mixed-case table names, it might not work correctly until you check and fix the names and/or the code. For best results, always use lowercase table names, so that you don't encounter this problem.[/quote] Quote Link to comment https://forums.phpfreaks.com/topic/7831-how-to-find-mysql-database-location-with-php/#findComment-28882 Share on other sites More sharing options...
yumico23 Posted June 14, 2006 Author Share Posted June 14, 2006 [!--quoteo(post=366734:date=Apr 20 2006, 03:34 AM:name=wisewood)--][div class=\'quotetop\']QUOTE(wisewood @ Apr 20 2006, 03:34 AM) [snapback]366734[/snapback][/div][div class=\'quotemain\'][!--quotec--]I just found this... which might help you.If you can find the data/ directory you might get lucky.[/quote]Hi Wisewood, thank you so much for your findings.I manage to find how to access to the database now. [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /] Quote Link to comment https://forums.phpfreaks.com/topic/7831-how-to-find-mysql-database-location-with-php/#findComment-45416 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.