Logging On to the MySQL Database Server

Logging On to the MySQL Database Server

To do anything with SQL (this applies to creating the sample database as well), you must log on to the database server. Most database servers (including MySQL) require that users identify themselves before manipulating the data in the database. In other words, the user has to log on by using an application. Identification is done with the help of a username and a password. Therefore, this chapter begins with an explanation of how to log on to a database server.

First, you need a username. However, to create a user (with a name and password), it is necessary to log on firsta classical example of a chicken-and-egg problem. To end this deadlock, most database servers create several users during the installation procedure. Otherwise, it would be impossible to log on after the installation. With MySQL, one of these SQL users is called root and has an identical password (if you have followed the installation procedure as described in the previous chapter).

How logging on really takes place depends on the application that you use. We assume that you use WinSQL. In this case, the logon screen looks like Figure.

1. The logon screen of WinSQL

The username is entered in the User ID text box and the password in the Password text box. In both cases, the word you type is root. Because of security aspects, the password characters appear as asterisks. Usernames and passwords are case-sensitive, so be sure you type them correctlynot with capitals! After the name and password have been entered, the user can log on and start entering SQL statements.

When you use the application called MYSQL that is included with MySQL, the process of logging on looks different but is still comparable; see Figure. The code u stands for user, behind which the username (root) is specified followed by the code p. Next, the application wants to know the password. We explain this in more detail in the next sections.

Figure. Logging on with MYSQL

The Web site contains detailed information about how to log on with different programs.

After you log on successfully with the users that are created during the installation procedure, new users can be introduced and new tables can be created.

 Python   SQL   Java   php   Perl 
 game development   web development   internet   *nix   graphics   hardware 
 telecommunications   C++ 
 Flash   Active Directory   Windows