unable to connect mysql

Issues related to applications and software problems

unable to connect mysql

Postby 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: Select all
[root@localhost ~]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)


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/recoveringre ... rd-in.html

but i cant connect in mysql again

Code: Select all
[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)
bersam
 
Posts: 1
Joined: 2012/02/27 09:44:53

unable to connect mysql

Postby 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.
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America


Return to CentOS 6 - Software Support

Who is online

Users browsing this forum: No registered users and 2 guests