Starting and Stopping mysql
Problem
You want to start and stop the mysql program.
Solution
Invoke mysql from your
command prompt to start it, specifying any connection parameters that
may be necessary. To leave mysql,
use a QUIT
statement.
Discussion
To start the mysql program,
try just typing its name at your command-line prompt. If mysql starts up correctly, you’ll see a
short message, followed by a mysql> prompt that indicates the program
is ready to accept statements. To illustrate, here’s what the welcome
message looks like (to save space, I won’t show it in any further
examples):
%mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 18427 to server version: 5.0.27-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>If you invoke mysql and you
get an error message that it cannot be found or is an invalid command,
that means your command interpreter doesn’t know where mysql is installed. See What to Do if mysql Cannot Be Found for instructions on setting the
PATH environment variable that your
command interpreter uses to find commands.
If mysql tries to start but exits immediately with an “access denied” message, you need to specify connection parameters. The most commonly needed parameters are the host to connect to (the host that runs the MySQL server), your MySQL username, and a password. For example:
%mysql -h localhost -p -u cbuserEnter password:cbpass
If you don’t have a MySQL username and password, you must obtain permission ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access