Checking Your System Works


After you have installed MySQL, set it up to run automatically on startup, and configured it, you should be able to connect to it.

You can do this by typing the following:

 
 mysql -u root 

You may need to supply a path to the mysql executable (for example, on Windows, typically c:\mysql\bin\mysql -u root ) or change your PATH .

This should log you in as the root (administrator) user to the MySQL monitor (a command-line interface to MySQL). You should see a welcome message similar to this:

 
 Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 4 to server version: 4.1.0-alpha-max-debug-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> 

Things that are likely to be different on your system are the connection id and the server version number. Don't worry about this.

If you get a message similar to

 
 ERROR 2003: Can't connect to MySQL server on 'localhost' (10061) 

it means the MySQL server is not running. You may want to restart your system so that the server has a chance to start automatically, or you can start the server manually by typing

 
 mysqld --standalone 

at a command prompt. (It's easiest to do this in one window and then open another window to log in.)

To log back out of the MySQL monitor, you can type this:

 
 \q 

(That's a backslash followed by q followed by Enter.)

Don't log out yet, though. (If you have already done so, just go ahead and log back in.) There are a couple more administrative things you need to do before you can really begin using your MySQL installation. These things are important, so you'll want to continue following along in this chapter.



MySQL Tutorial
MySQL Tutorial
ISBN: 0672325845
EAN: 2147483647
Year: 2003
Pages: 261

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net