Reputation: 18020
Even after I reset the root password with the following command I can not log to MySQL: (other commands listed to provide additional info)
# sudo dpkg-reconfigure mysql-server-5.1
# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
# telnet 127.0.0.1 3306
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
# ps -Aw |grep mysql
26522 ? 00:00:00 mysqld
# /etc/init.d/mysql start
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql start
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start mysql
update:
# sudo mysqladmin -u root password 123
mysqladmin: connect to server at 'localhost' failed
it seems MySQL is not running properly
Update: I am using MySQL 5.1 under Ubuntu. It was OK until that I make some change in my.cnf to enable Remote Access. I undo my changes but problems did not solved! (Perhaps I forgot to undo some thing!)
update:
# service mysql status
mysql start/running, process 26650
# /etc/init.d/mysql status
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql status
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the status(8) utility, e.g. status mysql
mysql start/running, process 26650
Upvotes: 2
Views: 16937
Reputation: 57
you should change the access permission. it should be 0644
sudo chmod 644 /etc/mysql/my.cnf
and then
sudo dpkg-reconfigure mysql-server-5.5
Upvotes: 0
Reputation: 1704
Start as a service
sudo service mysql restart
to verify & check the service and the port
sudo netstat -tap | grep mysql
Upvotes: 1
Reputation: 9875
It seems like MySQL is definitely not running. You can verify this with /etc/init.d/mysqld status
or service mysqld status
(don't link directly to the service command).
My spidey sense is telling me either your O/S or MySQL installation were performed improperly. It would help tremendously to know more about the (linux?) environment you're running, and how it was configured (or who configured it, in the case of PaaS).
Upvotes: 1
Reputation: 1100
My best guess is that if you have reconfigured / reinstalled MySQL, you need to login without a password, e.g.:
mysql -u root
or even
mysql
Edit: To see if the service is running, you could try:
service mysqld status
and if it is not running, try:
service mysqld start
then check the status again.
Upvotes: 2
Reputation: 1569
to set root password:
mysqladmin -u root password NEWPASSWORD
To recover it: http://www.cyberciti.biz/tips/recover-mysql-root-password.html
Upvotes: 2