LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-17-2008, 01:10 AM   #1
juchem
LQ Newbie
 
Registered: Feb 2008
Posts: 4

Rep: Reputation: 0
MySql 5.0 on Debian sid: ERROR 1045 (28000): Access denied


Hi, I'm running Debian sid (unstable).

I did a fresh install of the mysql-server package via aptitude, the installation went fine. I noticed that there was no /etc/mysq/my.cnf file, so I copied the /usr/share/doc/mysql-server-5.0/examples/my-small.cnf and chmod 644 just in case.
I did not set a password when the configuration dialog appeared in aptitude.

Then I try running 'mysql -u root' and I get the following error:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Just to be sure, I did a ping on localhost and it correctly returned 127.0.0.1.

I also tried creating the file ~/.my.cnf but it didn't work also:
[client]
user = root
[mysqladmin]
user = root

I then tried purging the package mysql-server in aptitude, choosen to remove all databases in the configuration dialog, and then reinstalled with a password set. 'mysql -u root -p', typed the password correctly, and I got the same error:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

I tried it several times, but I got no other result than that. I tried to dmesg but got nothing about mysql. Also tried to cat /var/log/mysql.err and /var/log/mysql.log but they are 0 bytes in size. There are also no files inside /var/log/mysql/.

I cheched if the process is running with 'ps -ef | grep -i mysql' and got:
root 13887 1 0 02:25 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe
mysql 13909 13887 0 02:25 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/localhost.pid --skip-external-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
root 13911 13887 0 02:25 ? 00:00:00 logger -p daemon.err -t mysqld_safe -i -t mysqld

Finally, I tried 'strace mysql -u root' just to be sure, and I noticed that the socket is connecting and there is a response from the server about access denied for the root user, so I think this is not a 'process isn't running', '/etc/hosts is not properly configured', 'firewall is blocking' or 'socket isn't connecting' issue:
...
socket(PF_FILE, SOCK_STREAM, 0) = 3
...
connect(3, {sa_family=AF_FILE, path="/var/run/mysqld/mysqld.sock"}, 110) = 0
setsockopt(3, SOL_SOCKET, SO_RCVTIMEO, "\2003\341\1\0\0\0\0", 8) = 0
setsockopt(3, SOL_SOCKET, SO_SNDTIMEO, "\2003\341\1\0\0\0\0", 8) = 0
setsockopt(3, SOL_IP, IP_TOS, [8], 4) = -1 EOPNOTSUPP (Operation not supported)
setsockopt(3, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
read(3, "7\0\0\0\n5.0.51a-3\0\30\0\0\0xD&3i;*\\\0,\242\10\2"..., 16384) = 59
...
write(3, "&\0\0\1\205\246\3\0\0\0\0\1\10\0\0\0\0\0\0\0\0\0\0\0\0"..., 42) = 42
read(3, "G\0\0\2\377\25\4#28000Access denied for u"..., 16384) = 75
shutdown(3, 2 /* send and receive */) = 0
close(3) = 0

I searched a lot on google and on several forums, including this one. Most people were having problems with missing password parameter 'mysql -u root -p', messing with the 'debian-sys-maint' user or misconfigured '/etc/hosts', but this is not my case.

I'm really clueless about that. Can anyone help me out?

Thanks,

Marcelo Juchem
 
Old 04-17-2008, 01:20 AM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Did you try

mysql -u root mysql

?
 
Old 04-17-2008, 05:47 AM   #3
mahmoud
Member
 
Registered: Apr 2006
Location: UK
Distribution: Mandriva, Debain, Redhat, Fedora, Ubuntu, FreeBSD
Posts: 269

Rep: Reputation: 30
whhen you were installing it did it ask you to set the root password if not then you dont need a password to get in try
mysql -u root or
mysql -u root -p then no password just hit enter when it prompts you for a password
 
Old 04-18-2008, 12:52 AM   #4
juchem
LQ Newbie
 
Registered: Feb 2008
Posts: 4

Original Poster
Rep: Reputation: 0
Yes, I tried every kind of password/passwordless authentication. Also tried with and without specifying the database as mysql.
Dpkg asks me if I wanna setup a password for mysql root after the installation, I tried inserting a password there and a passwordless configuration also.
Actually, I already did a good search on google about that, so every commom solution was already tried. I'm really clueless on this one.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) samnjugu Linux - Software 12 01-22-2013 06:22 AM
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) S canegames Debian 11 07-18-2007 12:57 PM
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) mohtasham1983 General 2 04-02-2007 06:36 PM
mysql root access err 1045... beware of this latino Linux - Newbie 0 03-15-2004 09:07 PM
MySQL: Access denied error Raptor Ramjet Slackware 5 02-22-2004 08:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration