| OK. Here's how it goes, HelloWorld:
1) You have users.
2) You have databases.
3) You have tables.
1 user can have access to 0 or more databases. Each database can have 0 or more tables.
You first connect to MySQL using your user. Since the user can access a number of databases, you must then tell MySQL which database you want to use (this user must have access to that database). After you have connected and indicated the database you can then perform operations on the selected database (such as creating a table).
This type of setup has a nice advantage - users can have limited privileges on a database to protect the database from undesired changes by that user (root, for example, can do whatever it wants, but you don't want any ole user to be able to have that same power). |