I am trying to learn PHP and MySQL and while I reached a chapter on MySQL I was asked to create a database using this command:
CREATE DATABASE publications;
After I typed it in the mysql console I got this error:
ERROR 1044(42000):Access denied for user ''@localhost' to database 'root'
I am already logged in to my administrator account so I think the privileges should't be a problem.I have installed with the XAMPP package.
How can this be solved?
Go to http://localhost/xampp/ and set the appropriate passwords (in Security tab). If you use
mysqlclient program, make sure you call it with appropriate credentials:mysql -u <username> -p <password>. Username will mostly berootuntil you create some new accounts.Then I suggest you use phpMyAdmin for experimenting with MySQL (it should be at http://localhost/phpmyadmin/ )