GeeCON Prague 2014*
The moose likes JDBC and the fly likes MYSQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "MYSQL" Watch "MYSQL" New topic
Author

MYSQL

nash avin
Ranch Hand

Joined: Nov 13, 2003
Posts: 96
Hi all,
I have installed MySQL 4.0.15 on a Win Xp Home OS.The installation is done in the C rive and I access the MySql server like this..(local machine)
C:\mysql\bin, this connects me to the server directly but....
I want to connect to the server by giving userid and password.
I would like to know how I could do it each time I try and connect to the server.
Hope the question is well stated.

any help would be greatly appreciated.
thanx
nash
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
You want to connect from the command line with a user name and password...
From the bin directory type this:
mysql -u name -p password
u is the username and p is the password
Hope thats what you were looking for


Dave
nash avin
Ranch Hand

Joined: Nov 13, 2003
Posts: 96
hi dave,
Thanks for the prompt reply.I havent given any userid,password during my installation of mysql 4.0.15-nt.
So I would like to know how I can give it.Hope I am clear on my problem.Your reply would be appreciated.
thanks
nash
nash avin
Ranch Hand

Joined: Nov 13, 2003
Posts: 96
hello ,
I addition to the previous message,kindly consider this too.As per the tutorial, at the shell c mysql\bin,i type the following......
"mysql -u root", it complains with the following error,let me know how I can got about this.
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)

Help would be appreciated
nash
Calvin Yan
Greenhorn

Joined: Jun 25, 2003
Posts: 19
I think it should be:
prompt> mysql -uroot mysql


I will do the best with what God gave me!
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
nash
Try to enter it this way:
"mysql -u root -p"
It should then prompt you for the password for the user root. After you enter it you should be ok.
If you haven't set up any users and passwords yet, then the default is a user named root with no password. so when it prompts you for the password just press enter.
For info o how to then set up some users check out this section of the online manual.
Hope that helps
nash avin
Ranch Hand

Joined: Nov 13, 2003
Posts: 96
thanks a lot people, you were very helpful.
I am figuring out what could be done after you have told a few tips.
nash
 
GeeCON Prague 2014
 
subject: MYSQL