|
Lesson 3 - MySQL: Still More Basics
MySQL 5.0.45 -
This is the version we're currently using. Versions of MySQL 3.23 (at least as far back as 3.23.39) are fine for most purposes. We've updated our MySQL installations with each new release and have had no
problems.
Setting up a database -
If you don't own your own web server with MySQL installed, you'll need the cooperation of your hosting company to set up your database. They will provide you with a username and password to access your MySQL
database on the server.
If you're lucky, you can use a GUI interface such as HeidiSQL installed on your PC to access the MySQL server and create your database and modify it. If not, your hosting
company will probably recommend or provide a web-based interface.
If you install PHP and MySQL on your local development machine or one on your LAN (if you have one), you can create your database locally with HeidiSQL, export it to a text file and then
import it into the live server on the web.
Designing a database -
Here, you're on you own. Hopefully, you know what you want to create for your own web site or your client has provided something to start with. Database design is beyond the scope of
these articles. (We get paid for that kind of stuff).
Later on in this tutorial, we'll work with a sample database that we've placed on our server and show you the text file (filename.sql) that was used to create it.
If you're really "feeling it" with your newfound connection with PHP, you can even write PHP scripts yourself to create, modify and drop (delete) tables in your database. We won't go there.
Database users -
You should set up two types of users for your database.
- Your own, with full privileges to add, delete and modify stuff. I.e., an administrator account.
- A webuser account with limited privileges. This may be limited to the ability to "select" information
from your database for display on your web pages. If you want visitors to add or modify records, you can add those privileges as well.
|