I'm having some difficulties with MySQL on my Ubuntu box. Just installed Apache, MySQL, PHP and phpMyAdmin. phpMyAdmin gives:
#1045 Cannot log in to the MySQL server
on every login attempt. I've tried username 'root' and empty password, username 'root' and password 'root', username 'mysql' and password 'mysql', username 'mysql' and password 'root'.
I also get
Access denied for user email@example.com error when I try to run
mysql in terminal:
mysql -u root
mysql -u root -p
or any of the combinations listed above. I also get access denied when I try these:
mysqladmin -u root password secret sudo /etc/init.d/mysql stop
service mysql stop
So - can anyone tell me how to get into my database? Thanks.
When I run
ps aux | grep mysql I see
sudo mysqld --skip-grant-tables.
After reboot I see
mysqld running. Then I try
service mysql stop and get the following:
user@host:$ service mysql stop stop: Rejected send message, 1 matched rules; type="method_call", sender=":1.47" (uid=1000 pid=2267 comm="stop mysql ") interface="com.ubuntu.Upstart0_6.Job" member="Stop" error name="(unset)" requested_reply=0 destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init"))
I finally managed to change my root password by using this command:
sudo dpkg-reconfigure mysql-server-5.1
Still have no idea why I couldn't log in before (don't remember setting any password previously). Also, not sure if the deamon now will run correctly after a reboot...