Link to home
Start Free TrialLog in
Avatar of Richard Korts
Richard KortsFlag for United States of America

asked on

phpMyadmin scripting

Is there a way to write a canned script for phpMyadmin (or MySQL itself) that can run under XAAMP to automatically build a database & import content from .sql files?

I need this capability since I need a simple way for non tech types to install a database from components on a CD or USB drive. I realize it's a piece of cake using phpMyadmin (I do it myself all the time).

I anticipate doing this in a Windows environment using XAAMP as web server software.

Thanks
SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Richard Korts

ASKER

Dave,

That sounds fine.

But every example I see assumes a "connect" with a user name & password BEFORE the database.

As far as I know, the mysqli_query function requires two arguments, a query & a link. If the link does not yet exist, how do I do this.

Seems like chicken and egg question.

Thanks
You have to have a name and password to access the DB in order to create any objects in it.

The credentials connect you to the server - after which you have to select the database you want to use.

You setup your connection with a username and password with rights to create tables etc - once that is established you can then issue your commands to create the DB objects.
The differences on the command line is that the output does not go to a browser and it is not running on a server.  So any functions that would use them won't work.  See my demo code in this question from yesterday: https://www.experts-exchange.com/questions/28672632/How-run-a-query-in-command-prompt-to-get-results-from-a-PHP-web-server.html  JulianH is correct, you do have to have the credentials.  But that is the same as on a web site too.
" JulianH is correct, you do have to have the credentials.  But that is the same as on a web site too. "

I don't follow how I do this. Are you saying there is a user name & password associated with the XAAMP server?

It seems to me that I can't create a database without a user name & password, is that user name & password for MySQL? How do I know / get that? XAAMP comes with MySQL set up.
OK, this has gotten way off on tangents, I will start over with an EXACT, specific question.

Look for it, under php & MySQL

Thanks