Ubuntu 11.04 # 2002 Unable to Log in to MySQL Server

I am trying to write my data in PhpMyAdmin and this gives me an error:

# 2002 Cannot log in to MySQL server

I tried changing passwords in phpmyadmin / config-db.php, still getting the same error. Iโ€™ve been looking for an answer for 2 hours, nothing helped ... Any ideas? I am using Ubuntu 11.04

Btw, I asked these instructions to download everything: http://www.howtoforge.com/installing-apache2-with-php5-and-mysql-support-on-ubuntu-11.04-lamp

+4
source share
1 answer

To help others who may run into a problem:

The problem was that the /etc/mysql/my.cnf file was writable by a user other than "root". Therefore, during the mysql installation, the file was ignored and the installation did not work.

Simple:

chmod 644 /etc/mysql/my.cnf aptitude remove mysql-server aptitude install mysql-server aptitude install mysql-common 

Is the work well done.

Aptitude, in my opinion, is much better than apt-get. It manages dependencies much better than the other, and you have less chance of problems.

+10
source

All Articles