On Sat, 05 Jun 2004 21:20:45 +0100, John <ph********@needshelp.com>
wrote:
I seem to have finally got MySQL running after a lot of difficulty.
In the book it says to type source C:\mysql\newland_tours.sql at the
mysql> prompt, to generate the newland_tours database in my copy of
MySQL.
I remember how confusing rhis can be. Before you start loading
databases, you need to know exactly how to log in at the mysql command
line. It gets confusing right there because you log in a bit
differently depending on whether or not you set up a user & password.
First off, you need to see if you can log in correctly. So, open your
Command Prompt and cd to the mysql/bin directory. On my machine, it's:
C:\> cd c:\mysql\bin
Once you get to the correct directory, try logging in without any
username or password like this:
C:\mysql\bin\> mysql
That will log you in as the root user if you haven't already set up a
password for root. If you have set a password up, then you can log in
with it like this:
C:\mysql\bin> mysql -u root -p
And then mysql will prompt you for the root password. The -u stands
for "user", which in this case is root. To log in as egghead, type:
C:\mysql\bin> mysql -u egghead -p
The -p means: prompt me for a password.
Now you can get your database loaded up. It will be easier for you if
you copy the C:\mysql\newland_tours.sql file to the mysql\bin
directory. Once you've done that, cd to the mysql\bin directory as if
you were going to log in, and do this:
C:\mysql\bin\mysql < newland_tours.sql
Or if you have a password,
C:\mysql\bin\mysql -u root -p < newland_tours.sql
And enter the password when prompted. If all goes well, you'll get
dumped back to the original prompt with no messages.
If you get errors, and you probably will:
Check that the database already exists. If not, then log in and create
it.
If it says "No database selected", open up the newland_tours.sql
file in notepad, and on the top line type:
USE DATABASE newland_tours;
or whatever the database name is. That should do it!