Mysql Access Denied Error

liunx

Guest
Hi<br />I'm setting up a mysql server locally so I can test some pages before pushing live.<br /><br />Everything seems to be working properly, except I can't connect to my database.<br /><br />I've recently installed mysql and ran the 'mysql_install_db' start-up script.<br /><br /><br />If I run:<br />sudo /usr/local/mysql/bin/mysqltest<br />Password:<br /><br />I get:<br /><br />/usr/local/mysql/bin/mysqltest: Failed in mysql_real_connect(): Access denied for user 'root'@'localhost' (using password: YES)<br /><br />Is this simply a permissions issue?If so, how do I fix it?<br /><br />Thanks in advance!<br />_________________<!--content-->
Ok, I think have to create a file `\windows\hosts' with the following information:<br /><br />127.0.0.1 localhost<br /><br /><br /><br />But how and where does it go in my mysql installation??<!--content-->
The file '\windows\hosts' should only be for windows. From your first post it appears you are running linux, in which case you would want your hosts file to be '/etc/hosts'. At any rate, I don't think this is your problem. I ran into this problem before, and what was causing me issue was not adding a user/setting a password for that user in MySQL. Have you done this yet? Let me know, and I can help you do that.<!--content-->
Hi<br />I have no problem starting the mysql daemon from the mysql pref panel, but<br />when I try and use the OSX terminal using:<br /><br />sudo ./bin/mysqld_safe<br /><br />I get<br /><br />Starting mysqld daemon with databases from /usr/local/mysql/data<br /><br />and nothing happens !!!!<br /><br />But, after I start it using the pref panel, I have no problem shutting down from the terminal using:<br /><br />/usr/local/mysql/bin/mysqladmin -u root shutdown<br /><br />I checked my '/usr/local/mysql/data' directory, only visible if logged in as root,<br />and my databases seem to be in a nested 'mysql' folder.<br />I wonder if this is part of the problem, maybe mysqld_safe is looking in the wrong place??<br /><br />Any ideas??<!--content-->
Hi Thanks<br />you're right, that wasn't my problem.<br /><br />I was able to connect using a '--no-defaults' option so I figured I needed to look at my my.cnf file.<br /><br />I commented out the PASSWORD line and that seemed to solve my problem.<br /><br />Still seem to have an issue starting my mysql daemon properly.<br />Can't seem to do it thru the osx terminal using<br /><br />cd /usr/local/mysql<br />sudo ./bin/mysqld_safe<br /><br />get a message saying:<br />Starting mysqld daemon with databases from /usr/local/mysql/data<br /><br />and nothing!!<br /><br />But no problems shutting down from the terminal!<br /><br />If I use the OSX mysql pref panel, I can start it, but I seem to need to do it twice.<br />Doing a mysqladmin status gives me a<br />error: 'Can't connect to local MySQL server through socket '/private/tmp/mysql.sock' (2)'<br /><br />stopping and starting again using the pref panel and I seem to be ok.<br /><br />funny stuff...actually NOT so funny since I've spent the last mostly sleepless, 5 days getting this to work:(<!--content-->
Hi<br />No problem issuing simple mysqladmin commands but if I shange user to root<br /><br />mysqladmin -u root -p status<br /><br />I get<br />Enter password: (I enter what I think is the root password here)<br />mysqladmin: connect to server at 'localhost' failed<br />error: 'Access denied for user 'root'@'localhost' (using password: YES)'<br /><br />I guess I need to reset the root password,<br />Can anyone help me here??<!--content-->
I merged your topics as they were the same<br />and looked to part of your original topic.<br /><br />It will help others if you post all your MySql questions <br />about your own server here<br />so they can follow along.<!--content-->
Try to log in to mysqladmin without the -p option to see if that helps. The problem I had is that I didn't set a password, but I did try using one to get into mysql.<!--content-->
 
Top