MySql database produces no records

Problems with the Linux version of XAMPP, questions, comments, and anything related.

MySql database produces no records

Postby Coastalguy » 06. March 2011 21:21

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:
Coastalguy
 
Posts: 47
Joined: 06. March 2011 21:06
Operating System: Windows 7 Home Premium

Re: MySql database produces no records

Postby Coastalguy » 09. March 2011 16:06

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.
Coastalguy
 
Posts: 47
Joined: 06. March 2011 21:06
Operating System: Windows 7 Home Premium

Re: MySql database produces no records

Postby Coastalguy » 23. September 2011 21:14

This topic no longer needed. Not sure how to end a topic on this forum though.
Coastalguy
 
Posts: 47
Joined: 06. March 2011 21:06
Operating System: Windows 7 Home Premium

Re: MySql database produces no records

Postby Sharley » 23. September 2011 21:24

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. :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 2 guests