Problems logging into mysql

Martin Webster lists at martinwebster.eu
Fri Jul 9 23:16:46 UTC 2010


On Fri, 2010-07-09 at 18:16 -0400, Bob wrote:

> I was trying to set up mysql and recieve this error.   I've tried to
> change in module but have had not any luck.   Thanks!   Bob   DBI
> connect failed : Access denied for user 'bob'@'localhost 

Check that you can connect to the test database:
$ mysql -u root test

You should connect without error. Next set-up users and permissions:
$ mysql -u root
mysql> UPDATE mysql.user SET Password = PASSWORD('password') WHERE User = 'root';
mysql> FLUSH PRIVILEGES;

You can set-up other users as follows:
mysql> CREATE USER 'bob'@'localhost' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'bob'@'localhost' WITH GRANT OPTION;

Note: you are creating a superuser 'bob' that can only connect from localhost.

Next time you access MySQL use:
$ mysql -u root -p

-- 
As ever,
.\\artin

Martin Webster • Profile: http://www.linkedin.com/in/martinwebster
AOL: martinjwebster • Wordpress: http://martinwebster.info/
Jabber: martinwebster at xmpp.org.uk • ICQ: 15893823





More information about the ubuntu-users mailing list