Jump to content

Recommended Posts

Posted

Hi

I'm setting up a mysql server locally so I can test some pages before pushing live.

 

Everything seems to be working properly, except I can't connect to my database.

 

I've recently installed mysql and ran the 'mysql_install_db' start-up script.

 

 

If I run:

sudo /usr/local/mysql/bin/mysqltest

Password:

 

I get:

 

/usr/local/mysql/bin/mysqltest: Failed in mysql_real_connect(): Access denied for user 'root'@'localhost' (using password: YES)

 

Is this simply a permissions issue?If so, how do I fix it?

 

Thanks in advance!

_________________

Posted

Ok, I think have to create a file `\windows\hosts' with the following information:

 

127.0.0.1 localhost

 

 

 

But how and where does it go in my mysql installation??

Posted

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.

Posted

Hi

I have no problem starting the mysql daemon from the mysql pref panel, but

when I try and use the OSX terminal using:

 

sudo ./bin/mysqld_safe

 

I get

 

Starting mysqld daemon with databases from /usr/local/mysql/data

 

and nothing happens !!!!

 

But, after I start it using the pref panel, I have no problem shutting down from the terminal using:

 

/usr/local/mysql/bin/mysqladmin -u root shutdown

 

I checked my '/usr/local/mysql/data' directory, only visible if logged in as root,

and my databases seem to be in a nested 'mysql' folder.

I wonder if this is part of the problem, maybe mysqld_safe is looking in the wrong place??

 

Any ideas??

Posted

Hi Thanks

you're right, that wasn't my problem.

 

I was able to connect using a '--no-defaults' option so I figured I needed to look at my my.cnf file.

 

I commented out the PASSWORD line and that seemed to solve my problem.

 

Still seem to have an issue starting my mysql daemon properly.

Can't seem to do it thru the osx terminal using

 

cd /usr/local/mysql

sudo ./bin/mysqld_safe

 

get a message saying:

Starting mysqld daemon with databases from /usr/local/mysql/data

 

and nothing!!

 

But no problems shutting down from the terminal!

 

If I use the OSX mysql pref panel, I can start it, but I seem to need to do it twice.

Doing a mysqladmin status gives me a

error: 'Can't connect to local MySQL server through socket '/private/tmp/mysql.sock' (2)'

 

stopping and starting again using the pref panel and I seem to be ok.

 

funny stuff...actually NOT so funny since I've spent the last mostly sleepless, 5 days getting this to work:(

Posted

Hi

No problem issuing simple mysqladmin commands but if I shange user to root

 

mysqladmin -u root -p status

 

I get

Enter password: (I enter what I think is the root password here)

mysqladmin: connect to server at 'localhost' failed

error: 'Access denied for user 'root'@'localhost' (using password: YES)'

 

I guess I need to reset the root password,

Can anyone help me here??

Posted

I merged your topics as they were the same

and looked to part of your original topic.

 

It will help others if you post all your MySql questions

about your own server here

so they can follow along.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...