Forum Moderators: coopster
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.
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
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.
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.