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.
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.
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
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?
05-03-2007, 09:02 AM #5
julia31
Registered User
Join Date: May 2007
Posts: 1
thank you navaho,
you saved my day
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?
08-19-2007, 09:38 AM #7
acme.mail.order
Hall of Famer
Join Date: Sep 2003
Location: Tokyo
Posts: 4,589
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?
09-14-2007, 10:25 PM #8
barrettclark
Registered User
Join Date: Sep 2007
Posts: 1
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
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
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
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.
03-22-2010, 02:54 AM #12
gustavo GRDesign
Registered User
Join Date: Mar 2010
Posts: 1
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
03-22-2010, 06:45 PM #13
acme.mail.order
Hall of Famer
Join Date: Sep 2003
Location: Tokyo
Posts: 4,589
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)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment