Exercises1. What is command completion. What are the relative advantages of installing
MySQL using the package, directory archive (tarball or “no-install”), or compiled methods. How do you verify the integrity of downloaded packages. How do you add the MySQL
bin directory to the operating system path?
94 | Chapter 2:Installing MySQL CHAPTER 3Using the MySQL MonitorMySQL has a
client-server architecture; clients connect to the server to perform database operations such as reading or storing data. There are many MySQL clients available,
including some that have graphical interfaces. You can also develop your own clients.
The standard MySQL command-line client or monitor program provided by MySQL
AB is the client you’ll probably use the most often. The monitor allows you to control almost all aspects of database creation and maintenance
using SQL and the customMySQL extensions to SQL.
In this chapter, we’ll examine how to start the monitor and how to run commands through the monitor either interactively or in batch mode. We’ll describe how you can access the inbuilt MySQL help functions, and how to test your MySQL setup using the sample databases from the book website. We’ll also take a quick look at a couple of graphical tools that you can use instead of the monitor.
Starting the MonitorThe monitor program is called simply mysql and is found in a directory with the other
MySQL programs. The exact location depends on your operating system and how you chose to install MySQL; we considered some of these
in Error Message About MySQLExecutable Programs Not Being Found or Recognized in Chapter If your MySQL server isn’t already running, start it using the appropriate procedure for your setup as discussed in Chapter 2. Now, follow these steps to start the monitor and connect to your MySQL server as the MySQL administrator (the MySQL root user) by typing this from the command line
mysql --user=rootIf you followed our instructions in Chapter 2, the MySQL root account is protected by
the password you chose earlier, and so you’ll get a message saying that you’ve been denied access to the server. If your server has a password, you should specify the password as follows
mysql --user=root --password=the_mysql_root_password95 If you get a message from the operating system saying that it can’t
find the MySQLprogram, you’ll need to specify the full path to the mysql executable file as discussed in
“Error Message About MySQL Executable Programs Not Being Found or Recognized.”
If you used a nonstandard socket file when starting your server, you’ll need to provide the details to any
MySQL client programs you run, including mysql
. For example,
you might type mysql \Share with your friends: