The steps are as follows:
-
Check that MySQL is running using the password defined in Step 19 of the MySQL installation instructions:
% /usr/local/mysql/bin/mysqladmin -p
secret
versionIf it isn't, then log in as the
root
user and start the MySQL DBMS using:% /usr/local/mysql/bin/safe_mysqld --user=mysql &
-
Start the MySQL command line interpreter using the same password as in the last step:
% /usr/local/mysql/bin/mysql -p
secret
-
Add a new user to the user table in the mysql database. Choose a username to replace username and a password to replace secret in the following command:
GRANT ALL PRIVILEGES ON winestore.* TO
username
@localhost IDENTIFIED BY 'secret
';MySQL responds with:
Query OK, 0 rows affected (0.00 sec)
Record the username and password for use in the examples in Chapter 3 to Chapter 13.
-
Quit the MySQL command interpreter with the command:
quit
MySQL responds with:
Bye
-
Test the user created in Step 3 by running the MySQL command interpreter using the username and password:
% /usr/local/mysql/bin/mysql -u
username
-psecret
MySQL responds with a message beginning:
Welcome to the MySQL monitor.
-
Quit the MySQL interpreter again with:
quit
The MySQL DBMS is now configured with a user who can access the winestore database from the database server machine localhost
. The winestore database can't be tested yet; the winestore database is loaded and tested in Section 3.2 in Chapter 3.