This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JDBC and the fly likes How to set administrative user in MySQL? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to set administrative user in MySQL?" Watch "How to set administrative user in MySQL?" New topic
Author

How to set administrative user in MySQL?

Rob Petterson
Ranch Hand

Joined: Jan 23, 2002
Posts: 149
This is what appears in dos:
mysql> USE wrox;
Error 1044:Access denied for user:'@localhost to database 'wrox'


Rob Petterson
SCJP
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

This should show you everything. MySQL actually has a really good on-line manual. You should use it. I do every day.


GenRocket - Experts at Building Test Data
Rob Petterson
Ranch Hand

Joined: Jan 23, 2002
Posts: 149
Gregg,
Thanks for the feedback.
I'm using the user name 'root' and I have set up a password for this username. I use this user name and passworrd in my JDBC coding and it connects up to the DB fine.
I'm just a little confused as to how to put the user name and password onto the command line - so that the DB realizes that it's 'root' as the user.
Is it a case of each time you fire up MySQL, that use must enter a user name followed by a password, before being able to select a database within MySQL etc.
I agree that the doc link youo sent is very good, but can you just expand on this point for me, as I'm a complete novice to this.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

[URLhttp://www.mysql.com/doc/en/mysql.html]Here[/URL] is another link to that information.
mysql -u username -ppassword database
I don't know why there is no space between the -p and the actual password, but that is how is works. Database is the name of the database you want to use.
Is that what you meant?
Rob Petterson
Ranch Hand

Joined: Jan 23, 2002
Posts: 149
Thanks Greg, I new it had to be something like that. It worked.
I've been having a good read through the on-line doc's - they're a good source of information too. Any suggestions for good books on MySQL?
Tina Coleman
Ranch Hand

Joined: Dec 12, 2001
Posts: 150
Any suggestions for good books on MySQL?

I've thumbed through a few of them and honestly haven't found any that seemed to offer me either more information or information in a better way than the MySQL manual. So, I printed it (double-sided, 4 pages per side: makes for very small type, but a more manageable heft) and keep it by the ready. (I also search through the online manual, particularly the version with user comments, but somehow having something I can thumb-through, highlight, and dog-ear is just necessary for my development process.)
Rob Petterson
Ranch Hand

Joined: Jan 23, 2002
Posts: 149
I agree with you. The books I've scanned through don't seem to as good as the on-line documentation.I'll think I'll print the manual.
 
GeeCON Prague 2014
 
subject: How to set administrative user in MySQL?