MySql 5.0 on Debian sid: ERROR 1045 (28000): Access denied
Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.