Previous Page
Next Page

Making the Connection

Now that you have a MySQL DBMS and client software to use with it, it would be worthwhile to briefly discuss connecting to the database.

MySQL, like all client-server DBMSs, requires that you log in to the DBMS before being able to issue commands. Login names might not be the same as your network login name (assuming that you are using a network); MySQL maintains its own list of users internally, and associates rights with each.

When you first installed MySQL, you were probably prompted for an administrative login (often named root) and a password. If you are using your own local server and are simply experimenting with MySQL, using this login is fine. In the real world, however, the administrative login is closely protected (as access to it grants full rights to create tables, drop entire databases, change logins and passwords, and more).


Using MySQL Administrator The MySQL Administrator Users view provides a simple interface that can be used to define new users, including assigning passwords and access rights.

To connect to MySQL you need the following pieces of information:

  • The hostname (the name of the computer)this is localhost if connecting to a local MySQL server

  • The port (if a port other than the default 3306 is used)

  • A valid user name

  • The user password (if required)

As explained in Chapter 2, "Introducing MySQL," all of this information can be passed to the mysql command-line utility, or entered into the server connection screen in MySQL Administrator and MySQL Query Browser.


Using Other Clients If you are using a client other than the ones mentioned here, you still need to provide this information in order to connect to MySQL.

After you are connected, you have access to whatever databases and tables your login name has access to. (Logins, access control, and security are revisited in Chapter 28, "Managing Security").

Previous Page
Next Page