Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySql Primer

Status
Not open for further replies.

Nilgni

Instructor
Feb 21, 2002
58
US
Coming from the world of Access and ASP.
Sorry for such 'FAQ' questions, but the faq on installing doesn't answer and I hoped that someone would be able to clear some of my newbie questions up for me.

I want to build multiple sites in PHP on one machine and as you would expect upload them to the web.

Multiple sites, multiple databases
Don't understand this concept? MySQL appears to install like a normal program on the machine in the Program files folder and run via a GUI client. If I create a new database, where does it install? How do I get to it. I understand the concept of connections strings and ODBC, but can you store an instance of MySQL in a db folder within you folder structure of your website like you would an .mdb file?


Local vs Web Host - how?
As discussed above, MS Access stores a local file in a local folder that I ftp over to the web host and the database is synched. How does one accomplish this? (you may alread have answered that above, but wanted to throw this one in to make sure it was covered)

Testing Server - local or online?
What do you feel is the best practice? I am now using Adobe CS5 (upgrading from CS4 today) and I know that it has this online version of viewing pages - though I haven't seen it yet). What is the new or best way to set up a testing server?

I am more than willing to read, but so far all of the tutorials and PHP books I have don't let me ask questions LOL. If you can point out a tutorial or primer - GREAT

Thanks Keith
 
I hope this helps a little bit...

The disc files representing MySQL database tables are NOT available for general access like an Access database. The MySQL table files should never be touched,...unless the server is stopped first and then only for copying. The MySQL database server is only accessible via TCPIP and must be approached as such. One way or another, ODBC drivers access the MySQL server via TCPIP. MySQL does NOT run via a GUI client, unlike Access.exe. That said, the MySQL server can be accessed and queried via TCPIP using a GUI (Toad, Query Browser, custom app...). I am only familiar with Winderz, so I will use Winderz-speak; the MySQL server is a proper service running in the background and is started and stopped as the host PC is turned on and off, respectively.

I am afraid I cannot help you with PHP at all, but hopefully this will help you determine your next step. I don't think I will be able to help you too much with a tutorial, other than the following link: This particular 'tutorial' is for the version 5.0 server. There are corresponding 'tutorials' available from the same basic source for other versions of the server.

Steve.
 
Thanks Steve,

K, so it is as I expected a service rathen than a stand-alone. Having it on my machine doesn't allow me to just ftp the updates up to the webhost version. After playing with the online control panel from my webhost, I see a backup utility that pseudo looks like a way to move information and structure back and forth.

So, for anyone else reading this, is it fair to say that if I should create a database on the webhost, connect to it and develop from there? Or do I attempt to use the export/import features to update?


 
smays said:
The MySQL database server is only accessible via TCPIP

The MYSQL database is accessible locally from the command line. No TCP involved, you just invoke mysql's own command line interpreter. you don't even need to specify a server address, it will connect to the local one by default.

Its just that mostly MYSQL is accessed remotely via an IP address.
As far as developing: Its really up to you. I would develop locally and then upload, if only to avoid the heavy traffic back and forth between the web application and the remote server. Also because developing remotely, you'll end up having to change the access a bit once you upload your DBs and have to access them locally on the webserver.

To transfer a DB from one place to another, you can use mysql's own backup utility mysqldump.

This is a command line utility that will produce a text file containing all the commands to rebuild the database and tables in it in another server. You can access the text file directly and modify anything you need. You can also store it as a backup etc...

As far as accessing goes, in MYSQL databases are self containing. GUI's will access the mysql instance and display all available databases.

Your PHP applications can be specific and only access the one they need to. This is done using the msyql functions in PHP. If done remotely they will require a Web address or an IP address to access and the appropriate credentials to access and query the DB from PHP's location. You will also need to specify the Database to use. All queries then will be performed on that database unless otherwise stated.
If done from within the same server, the "localhost" reference address can be used to access the server.




----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top