Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to set administrative user in MySQL?

 
Rob Petterson
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what appears in dos:
mysql> USE wrox;
Error 1044:Access denied for user:'@localhost to database 'wrox'
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This should show you everything. MySQL actually has a really good on-line manual. You should use it. I do every day.
 
Rob Petterson
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[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
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic