Forum Moderators: coopster

Message Too Old, No Replies

New to mySQL

         

itwebxpert

10:36 am on Dec 31, 2004 (gmt 0)

10+ Year Member



Hello all,

I am having trouble with using mySQL client program on my standalone PC. Can anyone advise what commands should be used to log in?

Salsa

10:45 am on Dec 31, 2004 (gmt 0)

10+ Year Member



At the command line, be in the same directory as the mysql client, then:

mysql -hlocalhost -uusername -ppassword

It's probably not necessary to include the -h option, and instead of including your password in the options, just -p will then prompt you for your password, like:

mysql -uusername -p

I hope this helps.

itwebxpert

11:12 am on Dec 31, 2004 (gmt 0)

10+ Year Member



Thank you for your prompt help.

When I issued the following commands:

mysql -uusername -p

MySQL has asked to enter password. I don't have a password yet?

I appreciate your advice.

Cheers

Salsa

11:15 am on Dec 31, 2004 (gmt 0)

10+ Year Member



Then just leave out the -p, and maybe try to log in as root:

mysql -uroot

itwebxpert

11:22 am on Dec 31, 2004 (gmt 0)

10+ Year Member



It did not work too. What about using mysqld instead of mysql?

Salsa

11:32 am on Dec 31, 2004 (gmt 0)

10+ Year Member



Yes! if you don't have mysqld running, nothing's going to work. Try starting that with:

mysqld --standalone

...then try mysql again.

...well, wait a minute. If you were being prompted for a mysql password, I think that mysqld should already be running. Hmm.

itwebxpert

12:18 pm on Dec 31, 2004 (gmt 0)

10+ Year Member



Thanks for your help.

I have tried the following commands to login to mySQL server in my standalone PC:

mysqld -h localhost -u root

the message i received is:

mysqld: can't change dir to 'mysql\localhost\' <Errcode: 2>
041231 12:14:30 Aborting
041231 12:14:30 mysqld: Shutdown Complete

or

mysqld -h localhost -u user

the same message received?

But if I typed:

mysql -h host -u user -p

MySQL asked to enter password?

Please advise?

Cheers

Salsa

1:20 pm on Dec 31, 2004 (gmt 0)

10+ Year Member



mysqld is the MySQL daemon program that runs in the background on your computer and processes all MySQL queries. It's not a program that you log into. If you're using a standalone version of MySQL, you simply start mysqld from the command line, like: mysqld --standalone ...as I mentioned in an earlier message, and let it run.

The mysql (all lowercase letters) client is a completely separate program from mysqld. The mysql client is just a little, specialiazed, command line program that lets you make queries to MySQL from the command line. (Little and specialized though it may be, I find it indispenable.)

With that cleared up, if yours is a brand new, fresh installation of MySQL, there usually are no passwords set, so, with mysqld already started, you should be able to simply type in "mysql" from the command line to enter the mysql client. A root user is always present in a new installation, however, so "mysql -u root" should work, too. When you issue the command, do be sure that you are in the same directory as the mysql client program, or include the path to it.

itwebxpert

3:52 pm on Dec 31, 2004 (gmt 0)

10+ Year Member



Yes, I am in the directory where both mysql and mysqld programs are located, i.e. in "mysql/bin/" directory.

Can you advise what commands should be issued in order to login? I really have trouble with that?

Or plz tell me how to find out MySQL program is working? Because it might not work - but I remember about three months ago when i first installed MySQL program in my PC, i would be able to log in with similar command to

mysqld -h localhost -u root

and to practice mySQL excercises. But I just upgraded my Operation System to Windows XP professional, so I reinstalled mySQL, and tried today - it has not worked?

Thank you in advance.