28 November 2008

Access denied Linux MySQL error solution

I have not worked much with Linux and today i installed MySQL on Ubuntu 8.10. I logged in using the command "mysql -u root -p password". I was happily logged into MySQL and was able to execute commands like "show databases".
Then tried to create a database called kilo using the command
create database kilo;
and was greeted with the error below.
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'kilo'

The problem was in the space between -u and root. So the correct command to use is mysql -uroot -ppassword