Go Back   The macosxhints Forums > OS X Help Requests > UNIX - General



Reply
 
Thread Tools Rating: Thread Rating: 487 votes, 4.98 average. Display Modes
Old 07-10-2006, 10:22 PM   #1
smpvic
Guest
 
Posts: n/a
mySQL: ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)

I am new to terminal and I am having trouble setting up MySql. I've installed it step by step and run mysql_install_db, but I'm having trouble connecting as root user.

Code:
My-Computer:/usr/local/mysql/bin saraparkinson$ ./mysql -uroot mysql
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)
Can connect with:

Code:
/usr/local/mysql/bin/mysql
Can anyone help me work out why I'm having trouble as root user?

I wanted to be able to add a database with:

Code:
My-Computer:/usr/local/mysql/bin saraparkinson$ ./mysqladmin -uroot create book_db
./mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'
before I connect to MySql. But as I am denied access I can't. Why is this happening?

Thanks in adv.
  Reply With Quote
Old 07-11-2006, 01:02 PM   #2
navaho
Triple-A Player
 
Join Date: Aug 2004
Posts: 200
It indicates that root has a password, but you are not supplying it, hence the (Using password: NO)

try using mysql -u root -p

The -p will make it prompt you for a password.
navaho is offline   Reply With Quote
Old 08-12-2006, 06:28 AM   #3
Gido
Registered User
 
Join Date: Aug 2006
Posts: 1
Edit config.inc.php this can be found in phpMyAdmin/libraries

change :

$cfg['PmaAbsoluteUri'] = '';

to

$cfg['PmaAbsoluteUri'] = 'localhost/phpmyadmin/';

change

$cfg['Servers'][$i]['host'] = 'localhost';

to

$cfg['Servers'][$i]['host'] = 'Localhost';

and enter you're password in :

$cfg['Servers'][$i]['password'] = '';

eg

$cfg['Servers'][$i]['password'] = 'password';

reboot MySQL
Gido is offline   Reply With Quote
Old 08-14-2006, 12:04 PM   #4
navaho
Triple-A Player
 
Join Date: Aug 2004
Posts: 200
Why, oh why, would you tell someone to reboot MySQL after making a change to the PhpMyAdmin config sheet?

And what does a web based php MySQL admin panel have to do with not being able to access MySQL via terminal?

Are you sure that you posted to the correct topic?
navaho is offline   Reply With Quote
Old 05-03-2007, 09:02 AM   #5
julia31
Registered User
 
Join Date: May 2007
Posts: 1
thank you navaho,

you saved my day
julia31 is offline   Reply With Quote
Old 08-19-2007, 08:37 AM   #6
cbone
Registered User
 
Join Date: Aug 2007
Posts: 1
1045..

Hi, I had MySQL installed and working. I could log onto my server perfectly fine, but after my computer had been reset I received the error, as if SOMETHING had changed over night... I have no idea how to fix this. Iíve read forums and found nothing that helps. Any thoughts?
cbone is offline   Reply With Quote
Old 08-19-2007, 09:38 AM   #7
acme.mail.order
League Commissioner
 
Join Date: Sep 2003
Location: Tokyo
Posts: 6,334
Generally we don't dredge up year-old threads to deal with new problems (esp. as this one's been brought back once already)

You should start a new thread detailing what you had working, and exactly what you are doing, including detailed error messages. When you say your computer was 'reset' what does that mean? reboot? software restore? update?
acme.mail.order is offline   Reply With Quote
Old 09-14-2007, 10:25 PM   #8
barrettclark
Registered User
 
Join Date: Sep 2007
Posts: 1
Thumbs up Many Thanks

Quote:
Originally Posted by Gido
Edit config.inc.php this can be found in phpMyAdmin/libraries

change :

$cfg['PmaAbsoluteUri'] = '';

to

$cfg['PmaAbsoluteUri'] = 'localhost/phpmyadmin/';

change

$cfg['Servers'][$i]['host'] = 'localhost';

to

$cfg['Servers'][$i]['host'] = 'Localhost';

and enter you're password in :

$cfg['Servers'][$i]['password'] = '';

eg

$cfg['Servers'][$i]['password'] = 'password';

reboot MySQL

Quote:
Originally Posted by navaho
It indicates that root has a password, but you are not supplying it, hence the (Using password: NO)

try using mysql -u root -p

The -p will make it prompt you for a password.

I have been fighting with MySQL and phpMyAdmin for a LONG time. I juat got a shiny new iMac and took another run at it. I got all kinds of errors trying to access the database (command-line and php). MySQL and php forums are full of help that is anything but. Then I found these posts. I kept trying to login like I would to Sybase. MySQL != Sybase.

I also FINALLY got phpMyAdmin to work. I know the post makes no sense with respect to the rest of the postings, but it did turn out to be exactly what I needed to make that heap work. I somehow made it work a few years back, and then could never get it to work on any other computer or any other version of phpPleaseFindMyDatabaseAndWorkDamnit.

So thank you to both of you
barrettclark is offline   Reply With Quote
Old 05-24-2009, 04:00 PM   #9
Rionsic
Registered User
 
Join Date: May 2009
Posts: 1
Quote:
Originally Posted by Gido
Edit config.inc.php this can be found in phpMyAdmin/libraries

change :

$cfg['PmaAbsoluteUri'] = '';

to

$cfg['PmaAbsoluteUri'] = 'localhost/phpmyadmin/';

change

$cfg['Servers'][$i]['host'] = 'localhost';

to

$cfg['Servers'][$i]['host'] = 'Localhost';

and enter you're password in :

$cfg['Servers'][$i]['password'] = '';

eg

$cfg['Servers'][$i]['password'] = 'password';

reboot MySQL

I just had to register to say this, than you very much, had this problem and thanks to you Gido, it is gone
Rionsic is offline   Reply With Quote
Old 07-29-2009, 03:35 PM   #10
basse
Registered User
 
Join Date: Jul 2009
Posts: 1
got this problem today after upgrading my linux box.

If you dont wont to hardcode the password, but instead have login, just uncomment this line:
$cfg['Servers'][$i]['auth_type'] = 'cookie'; //

I also had to change the server from "localhost" to "Localhost"...

hope this helps,
basse
basse is offline   Reply With Quote
Old 10-29-2009, 03:42 PM   #11
riya
Registered User
 
Join Date: Oct 2009
Posts: 1
HAving a problem with mysql config

hi
i tried to confi mysql with php

error: error: 'Access denied for user: 'root@localhost' (Using password: NO)'[/code]

i m using windows xp.how u solved that problem.i did whatever answered u got.but i m getting same error.

thanks

Quote:
Originally Posted by smpvic
I am new to terminal and I am having trouble setting up MySql. I've installed it step by step and run mysql_install_db, but I'm having trouble connecting as root user.

Code:
My-Computer:/usr/local/mysql/bin saraparkinson$ ./mysql -uroot mysql
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)
Can connect with:

Code:
/usr/local/mysql/bin/mysql
Can anyone help me work out why I'm having trouble as root user?

I wanted to be able to add a database with:

Code:
My-Computer:/usr/local/mysql/bin saraparkinson$ ./mysqladmin -uroot create book_db
./mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'
before I connect to MySql. But as I am denied access I can't. Why is this happening?

Thanks in adv.

riya is offline   Reply With Quote
Old 03-22-2010, 02:54 AM   #12
gustavo GRDesign
Guest
 
Posts: n/a
hello,

please can anyone help me, i am trying to start a site with my sql, i understand the whole table thing and the database and all that, the only thing i dont get is the connect, i dont get what the **** your suppose to put when connecting

$con = mysql_connect(hostname,username,password) OR DIE ('Unable to connect to database! Please try again later.'

see this line, i have tryied everything i can think of, but the instructions say not to use local host, so what the f***k am i suppose to use, ive tried everyserver name and number i have, and then i try to do it with the dreamweaver , and nothing, can you please help, i dont know what to do and im stuck, i have tried to look it up online but they just tell me to use local host, i am using phpmyadmin, php5 , please if you can reply let me know via email, gustavoruiz@ubuildurbiz.com..

thank you for your time
  Reply With Quote
Old 03-22-2010, 06:45 PM   #13
acme.mail.order
League Commissioner
 
Join Date: Sep 2003
Location: Tokyo
Posts: 6,334
First problem I see is this:

$con = mysql_connect(hostname,username,password)

'hostname' should perhaps be $hostname, and defined earlier.

Question 1: is your development website hosted on your own computer? (if you are using a web hosting company we can stop here - call that company for support.)

Question 2: How and where did you install MySQL? (it doesn't come with OSX)
acme.mail.order is offline   Reply With Quote
Old 04-20-2011, 12:12 AM   #14
hacker269
Guest
 
Posts: n/a
Thumbs up

Quote:
Originally Posted by Gido
Edit config.inc.php this can be found in phpMyAdmin/libraries

change :

$cfg['PmaAbsoluteUri'] = '';

to

$cfg['PmaAbsoluteUri'] = 'localhost/phpmyadmin/';

change

$cfg['Servers'][$i]['host'] = 'localhost';

to

$cfg['Servers'][$i]['host'] = 'Localhost';

and enter you're password in :

$cfg['Servers'][$i]['password'] = '';

eg

$cfg['Servers'][$i]['password'] = 'password';

reboot MySQL

O MHUY GOD! you saved my private servers!
  Reply With Quote
Old 07-20-2011, 01:13 PM   #15
spokenup
Prospect
 
Join Date: Jul 2011
Posts: 7
Quote:
Originally Posted by hacker269
O MHUY GOD! you saved my private servers!

Are you using a cloud service because I plugged in the same thing and got nothing....
spokenup is offline   Reply With Quote
Old 01-08-2014, 06:26 PM   #16
PhilSmith
Registered User
 
Join Date: Jan 2014
Posts: 1
I just had to post this (even if it meant registering): I was experiencing this problem, googled it to see if the solution was known. I found this thread. I tried every "solution" to no avail. So I decided to use tcpdump to see what the actual dialog was (although it was probably encrypted) and guess what? It started working.

Now, I don't know if you're all aware of the famous double-slit experiment in quantum physics, but if you are, you know about the fact that if you put a detector on one of the slits the interference stops. That's what it felt like to me, the detector made the problem go away. Schroedinger's cat lives!
PhilSmith is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 08:01 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.