HELP!!! phpMyAdmin MySQL data path ISN'T htdocs

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

HELP!!! phpMyAdmin MySQL data path ISN'T htdocs

Postby OrcaSoul » 01. June 2014 06:03

I just installed the newest XAMPP in Win 7, fixed all the security items and http://localhost/phpmyadmin loads as it should. The only problem left is the list of databases on the left - they do not include the contents of htdocs folder. I created a new DB, and then tracked the name to the C:\xampp\mysql\data\ folder... So obviously phpMyAdmin is pointed at the wrong folder for the database - how and what do I change to make it point to the C:\xampp\htdocs folder?

I reloaded the older version of XAMPP, I can access the databases and tables, and exported the database I need to an SQL format file. But, after reloading the new version and attempting to import it, I get a notice that there are no tables in the DB...

After 3 days and many re-installs to learn all the tricks to passwords and security and such, this is getting really frustrating, and I need to have a working DB in 2 days!

ALL I need (I hope) is a clue as to where I can change the data path from sql/data to htdocs like it was supposed to be...
OrcaSoul
 
Posts: 57
Joined: 24. August 2009 23:51

Re: HELP!!! phpMyAdmin MySQL data path ISN'T htdocs

Postby Nobbie » 01. June 2014 10:55

I can change the data path from sql/data to htdocs like it was supposed to be...


The data path of MySQL NEVER EVER has been set to htdocs (you must have dreamed this!!). Instead it has EVER been mysq/data. This is standard MySQL since many years. I have NEVER seen another installation.

Of course you might change this in the MySQL configuration (my.ini oder my.cnf in the mysql/bin folder), but this will definately screw up your MySQL installation!

If have no idea, what you are going for, but this one is completely wrong and you obviously are mixing up things in the wrong way.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: HELP!!! phpMyAdmin MySQL data path ISN'T htdocs

Postby OrcaSoul » 01. June 2014 14:15

Hmmm...Perhaps I need to be clearer about this - I've used XAMPP for a couple of years, and the folder for databases has always been xampp/htdocs...mySQL is part of the XAMPP installation, just as php is.
Perhaps I am in the wrong forum - when I search for help on XAMPP I get lead to Apache Friends, but maybe that's incorrect...
OrcaSoul
 
Posts: 57
Joined: 24. August 2009 23:51

Re: HELP!!! phpMyAdmin MySQL data path ISN'T htdocs

Postby OrcaSoul » 01. June 2014 20:28

I just installed the newest XAMPP in Win 7, fixed all the security items and http://localhost/phpmyadmin loads as it should. The only problem left is the list of databases on the left - they do not include the contents of htdocs folder. I created a new DB, and then tracked the name to the C:\xampp\mysql\data\ folder... So obviously phpMyAdmin is pointed at the wrong folder for the database - how and what do I change to make it point to the C:\xampp\htdocs folder?

Update:

OK, I reloaded XAMPP again, version 1.8.3-4 on Windows 7. After the install I copied the database I need into the C:\xampp\mysql\data\ folder. I then made the security changes needed, and called http://localhost/phpmyadmin - which loaded the DB and I was able to open it and scan the table data. I then exited and called a php file that reads the data - it failed with the "missing data" error. As a test I copied the same database files into the htdocs folder, then called the php file again - and it ran! So...I have a database that I can look at when it is in a folder that is not the one XAMPP is supposed to be looking at, but and changes I make to the data inside the tables - in the C:\xampp\mysql\data\ files will not show up when I run the php scripts to see the data in the C:\xampp\htdocs folder.

Is this a bug in XAMPP? Has anyone else had this problem? Are these invalid questions?

I am told I can get help here, are there no experts who see this and can offer at least an acknowledgement that this is a problem?
OrcaSoul
 
Posts: 57
Joined: 24. August 2009 23:51

Re: HELP!!! phpMyAdmin MySQL data path ISN'T htdocs

Postby Nobbie » 01. June 2014 21:21

OrcaSoul wrote:Hmmm...Perhaps I need to be clearer about this - I've used XAMPP for a couple of years, and the folder for databases has always been xampp/htdocs...mySQL is part of the XAMPP installation, just as php is.


NO. Definately NOT. The database folder has NEVER been htdocs. Not for Xampp, not for MySQL, never ever. You are wrong, without any doubts. It would have been a horrible security leak to put the MySQL data into htdocs. This has not happen, ever.

OrcaSoul wrote:Perhaps I am in the wrong forum - when I search for help on XAMPP I get lead to Apache Friends, but maybe that's incorrect...


Dont now. But htdocs has never been the MySQL data folder, nowhere in the world.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: HELP!!! phpMyAdmin MySQL data path ISN'T htdocs

Postby Nobbie » 01. June 2014 21:28

OrcaSoul wrote:As a test I copied the same database files into the htdocs folder, then called the php file again - and it ran! So...I have a database that I can look at when it is in a folder that is not the one XAMPP is supposed to be looking at, but and changes I make to the data inside the tables - in the C:\xampp\mysql\data\ files will not show up when I run the php scripts to see the data in the C:\xampp\htdocs folder.

Is this a bug in XAMPP? Has anyone else had this problem? Are these invalid questions?


No, it is not a bug.

I think (as your description is horribly bad and lacks tons of information) that you are mixing up a "Database" (what is usually a folder) with a backup file, what usually looks like a single file with *.sql Extension. In case i am right: these are TOTALLY different things. One thing is a database for the MyISAM Engine, the other thing (file *.sql) is only a backup file, NOT a database.

I am not sure if you understand, what the (very very big) difference is, and I am not sure, if am I right. But your explanation is poor and lacks of basic knowledge. Anyway: a database of MySQL has NEVER been in htdocs. Never. Forget about that, it is wrong.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: HELP!!! phpMyAdmin MySQL data path ISN'T htdocs

Postby OrcaSoul » 01. June 2014 22:43

OK, we seem to be seeing different words when looking at this.
I may have been in error to mention the "SQL files" when I should perhaps be referring to the "database files" - the files that actually hold the database data.
I think this is a phpMyAdmin issue, not an SQL issue - my error due to being somewhat new at this... :oops:

Here is the short layout of the problem as I see it:
When I create a database in phpMyAdmin, it is supposed to be saved in htdocs.
This is from the Apache Friends own FAQ page on XAMPP https://www.apachefriends.org/faq_windows.html:
Where should I place my web content?

The main directory for all WWW documents is \xampp\htdocs. If you put a file "test.html" in this directory, you can access it with the URI "http://localhost/test.html".

But, when I install the newest version of XAMPP - 1.8.3-4 for Windows, when I open phpMyAdmin and look at the list of included databases, it shows me the ones in the [url]C:\xampp\mysql\data[/url] folder. I know this because when I couldn't find these in htdocs I created a database named "DBtest", and then used windows explorer search the xampp folder for any file called "DBtest" - and it found it in the [url]C:\xampp\mysql\data[/url] folder.

When I first installed XAMPP, I placed my "SCW-FILES" database in the htdocs folder so it could be seen and read by phpMyAdmin - which is the normal way to copy existing databases into a fresh install of XAMPP.
When I first installed XAMPP, I placed my "SCW-FILES" database in the htdoc folder, but phpMyAdmin could not find it.

When I reinstalled XAMPP, I placed my "SCW-FILES" database in the mysql/data folder so I could read it, and it was there and I could scan the tables.

So...the phpMyAdmin is directed to use the mysql/data folder, not htdocs.
I checked the phpinfo list, it shows that the data directory is htdocs:
DOCUMENT_ROOT C:/xampp/htdocs


And yet, phpMyAdmin goes to mysql/data... :roll:

Oddly enough, while I can modify the database manually in phpMyAdmin, any attempt to have a php file interact with it gives me a data not found error...until I copy the database file into the htdocs folder, THEN the php can access the data!

So, I can manually modify the data in mysql/data, but only use php in htdocs - and they are not the same files, each is a copy!

As I say, this is not the way it is supposed to be...and I need to fix this ASAP.

I may, if desperate enough, use the php to modify the data in htdocs, then copy THAT into mysql/data to be able to check it - but that is not a solution, it is simply a tedious workaround...and totally unnecessary.

Hopefully this has cleared up any confusion I may have created.
OrcaSoul
 
Posts: 57
Joined: 24. August 2009 23:51

Re: HELP!!! phpMyAdmin MySQL data path ISN'T htdocs

Postby JJ_Tagy » 02. June 2014 00:27

OrcaSoul wrote:When I create a database in phpMyAdmin, it is supposed to be saved in htdocs.

That is incorrect. As Nobbie has stated, it never gets stored there. If you have a script/application that stores it there, then there is little we can do for you. It is just not correct.

OrcaSoul wrote:When I first installed XAMPP, I placed my "SCW-FILES" database in the htdocs folder so it could be seen and read by phpMyAdmin - which is the normal way to copy existing databases into a fresh install of XAMPP.

That is also incorrect and very dangerous for your database files. The normal way to import a database is to export the database from a previous installation into a SQL (or multiple SQL if you desire), and then import them into your new database system.

OrcaSoul wrote:When I first installed XAMPP, I placed my "SCW-FILES" database in the htdoc folder, but phpMyAdmin could not find it.

Correct. It should not find it there as that is not the proper location to store database files.

OrcaSoul wrote:...until I copy the database file into the htdocs folder, THEN the php can access the data!

Then you have a script problem or specification that is not in line with MySQL and phpmyadmin.

OrcaSoul wrote:As I say, this is not the way it is supposed to be...and I need to fix this ASAP.

And the rest of the users say that it is not and nothing with the existing system needs to be fixed.

OrcaSoul wrote:I may, if desperate enough, use the php to modify the data in htdocs, then copy THAT into mysql/data to be able to check it - but that is not a solution, it is simply a tedious workaround...and totally unnecessary.

I agree with this statement. It would be a very bad idea and bad practice.
JJ_Tagy
 
Posts: 788
Joined: 30. January 2012 13:44
XAMPP version: 5.5.15
Operating System: Windows 10 Pro x64

Re: HELP!!! phpMyAdmin MySQL data path ISN'T htdocs

Postby Nobbie » 02. June 2014 10:21

OrcaSoul wrote:When I create a database in phpMyAdmin, it is supposed to be saved in htdocs.


No.

OrcaSoul wrote:This is from the Apache Friends own FAQ page on XAMPP https://www.apachefriends.org/faq_windows.html:
Where should I place my web content?

The main directory for all WWW documents is \xampp\htdocs. If you put a file "test.html" in this directory, you can access it with the URI "http://localhost/test.html".


This is right - but this DOES NOT mean any databases of any SQL installation, this means (and ONLY means) your HTML files and your PHP files. Only the files, which are processed by Apache, when a user enters an URL in it's browser and the browser sends a request to your server, then this request is handled by Apache and Apache delivers the requested files from your htdocs. THIS HAS NOTHING(!!) TO DO WITH MYSQL OR ANY OTHER SQL DATABASE. YOU WILL NEVER DELIVER DATABASES FROM YOUR SERVER.

OrcaSoul wrote:But, when I install the newest version of XAMPP - 1.8.3-4 for Windows, when I open phpMyAdmin and look at the list of included databases, it shows me the ones in the [url]C:\xampp\mysql\data[/url] folder. I know this because when I couldn't find these in htdocs I created a database named "DBtest", and then used windows explorer search the xampp folder for any file called "DBtest" - and it found it in the [url]C:\xampp\mysql\data[/url] folder.


Yes, thats right, because MySQL and also phpmyadmin dont know ANYTHING about Apache and HTML or PHP Files. This is a local SQL Database and it comes with its own configuration files. But Xampp is a distribution, which delivers as well Apache as MySQL (you also might download these tools seperately direct from their own sites) and therefore they are packed together under the top level Xampp folder. And thats all. In any case, MySQL has its own "data" folder and this data is different from your "data", which is mentioned by the Apache explanation above. One word (data) for two completely different things.

Unless you really fully understand this, you will never succeed in running your own applications.

OrcaSoul wrote:When I first installed XAMPP, I placed my "SCW-FILES" database in the htdocs folder so it could be seen and read by phpMyAdmin - which is the normal way to copy existing databases into a fresh install of XAMPP.
When I first installed XAMPP, I placed my "SCW-FILES" database in the htdoc folder, but phpMyAdmin could not find it.

When I reinstalled XAMPP, I placed my "SCW-FILES" database in the mysql/data folder so I could read it, and it was there and I could scan the tables.


What are SCW-FILES??

OrcaSoul wrote:So...the phpMyAdmin is directed to use the mysql/data folder, not htdocs.


Yes, and this RIGHT.

OrcaSoul wrote:I checked the phpinfo list, it shows that the data directory is htdocs:
DOCUMENT_ROOT C:/xampp/htdocs



And this is right as well. BUT: a DocumentRoot is used ONLY(!!) by Apache. It is NOT used by MySQL and NOT used by phpmyadmin. Only Apache knows, what a DocumentRoot means.

OrcaSoul wrote:Hopefully this has cleared up any confusion I may have created.


So and so - your are obviously very confused. But the main problem is, that you have NO IDEA how these tools are working and working together. And you are mixing up everything what cannot be mixed. We hardly can help you, as you get everything wrong. I dont think, that you will succeed, until you go deeper into documentation and learn, how it all works. By now, there is no chance.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: HELP!!! phpMyAdmin MySQL data path ISN'T htdocs

Postby OrcaSoul » 02. June 2014 20:07

OK, I get it - "database" = MySQL goes in MySQL/data, php & html files go in htdocs...
What I was calling "database" was the php/html. Got it.

I reinstalled xampp, copied the existing htdocs & MySQL/data folders into the new folders.
It ran, loaded the database & I can see the structure in phpMyAdmin.
When I click to browse a table, I get a pink error message:
#1146 - Table 'phpmyadmin.pma__table_uiprefs' doesn't exist


Also, the html/php in htdocs is working, I can get data from the tables.
OrcaSoul
 
Posts: 57
Joined: 24. August 2009 23:51


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 139 guests