Page 1 of 1

MySql database produces no records

PostPosted: 06. March 2011 21:21
by Coastalguy
I have had a LAMP (Sokkit), set up on my windows for years where I test websites before uploading. Now, dual booting between my XP and Ubunu Meerkat, I want first a backup if my xp fails, and also someday move over to Linux.

To accomplish this, I installed your XAMPP for Linux. First, after having to do special mounting of my NTFS windows partition and changing the DocumentRoot and Directory for Apache2. I am now able to display my sites along with PHP code.

I now have 2 problems, relating to my MySql databases and PhpMyAdmin. First, on every database display on my sites, that run fine under Sokkit, I am getting the error: Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /media/Sokkit/_LC/index.php on line 103. When I added a num_rows to display the number of records selected, it shows 0 records, although there are many records in the database, again which display fine on my windows Sokkit LAMP.

My second problem, is with PHPMyAdmin, which I can login and which displays databases from what I assume to be those installed into whatever default folder that was used? What I would like to do is repoint phpmyadmin to my existing databases on a different folder.

My localhost, which is working fine is: /media/Sokkit/
My Mysql databases are located under this localhose folder at: /media/Sokkit/Sokkit/mysql4/data

Can someone possibly help?
thanks, :cry:

Re: MySql database produces no records

PostPosted: 09. March 2011 16:06
by Coastalguy
Followup...

I added code for "or die" to my mysql_select_db and the query selection lines, and I now get an error message that it cannot locate the database. If I am correct, MySQL is still "looking" at the XAMPP installation default directory for the databases, and not the directory where I have them installed (using a LAMPP on Windows for years).

As my Phpmyadmin also does not find them, it seems that I need to redirect where MySql is looking to my existing databases. Can someone help me change the "datadir" for Mysql?

I have Apache DocumentRoot and Directory redirecting localhost to my existing websites, which is working fine, with PHP. However, I cannot get the databases to work, apparently as it is still looking in the default install directory.

If I knew where the installed databases were, I could copy them from my Windows directory (if I knew where the XAMPP default database directory was), however as this would have to be done each time I updated them on Windows, it would not be my best option. Having my XAMPP MySQL "see" them directly from my Windows directory is my preferred method. Can someone help.

Re: MySql database produces no records

PostPosted: 23. September 2011 21:14
by Coastalguy
This topic no longer needed. Not sure how to end a topic on this forum though.

Re: MySql database produces no records

PostPosted: 23. September 2011 21:24
by Sharley
Topic closed by OP request.

Topic reopened because it is now linked from another post and to add more info for would be searchers.
viewtopic.php?p=185546#p185546

_______________________________________________________________

Perhaps these Google search results for...
sharing a mysql database between linux and windows
...may hold a solution as there seems to be plenty of discussion about this subject, but as yet I have not had time to browse them.

Good luck. :)