Connecting to the sample database (PHP) 317
3. In Windows, enter your username (if any) and password, and then press
Enter.
The MySQL client’s command prompt appears, as follows:
mysql>
4.
On the Macintosh, enter the following command:
mysql -uUser -pPassword
For example, if your MySQL user name (also known as an account
name) and password are Tara and Telly3, enter the following
command:
mysql -uTara -pTelly3
If you don’t have a password, omit the -p argument as follows:
mysql -uTara
If you didn’t define a user name while configuring your MySQL
installation, enter root as the user name, as follows:
mysql -uroot
The MySQL client’s command prompt appears, as follows:
mysql>
5.
Create a new database by entering the following command at the
MySQL prompt:
mysql>CREATE DATABASE CafeTownsend;
MySQL creates a new database, but it doesn’t contain any tables or
records yet.
6. Log out of the MySQL client by entering the following command at the
prompt:
mysql>quit;
7.
(Windows) Open the Windows command prompt by selecting Start >
Run, and typing cmd in the Run dialog box.