unable to connect mysql

Issues related to applications and software problems
Post Reply
bersam
Posts: 1
Joined: 2012/02/27 09:44:53

unable to connect mysql

Post by bersam » 2012/02/27 09:47:25

Os: centos
yum install httpd mysql php-mysql php phpmyadmin

and set 3 priviliage for localhost in phpmyadmin with different password
then i cant connec in mysql with php or phpmyadmin

[code]
[root@localhost ~]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[/code]

then remove phpmyadmin , mysql , php and re install them
but i cant connect in mysql again

then try to reset password

http://www.rhel.in/2011/03/recoveringresetting-mysql-password-in.html

but i cant connect in mysql again

[code]
[root@localhost ~]# /etc/init.d/mysqld stop
/etc/init.d/mysqld: line 16: .: /etc/sysconfig/network-scripts: is a directory
Stopping mysqld: [ OK ]
[root@localhost ~]# vi /root/mypassreset.sql
[root@localhost ~]# mysqld_safe --init-file=/root/mypassreset.sql &
[1] 12212
[root@localhost ~]# 120227 16:40:08 mysqld_safe Logging to '/var/log/mysqld.log'.
120227 16:40:08 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120227 16:40:14 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
[1]+ Done mysqld_safe --init-file=/root/mypassreset.sql
[root@localhost ~]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
[root@localhost ~]# service mysqld start
/etc/init.d/mysqld: line 16: .: /etc/sysconfig/network-scripts: is a directory
Starting mysqld: [ OK ]
[root@localhost ~]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[/code]

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

unable to connect mysql

Post by pschaff » 2012/03/01 19:25:22

Welcome to the CentOS fora. Please see the recommended reading for new users linked in my signature.

Removing and reinstalling is not likely to help with a configuration issue. Have you tried googling the [url=MySQL "ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)"]error[/url]? Seems to be a rather common problem.

Post Reply