Reputation: 3203
I just recently installed mySQL on my Mac running 10.10.3, but I can't create any tables or modify anything associated with my databases. When I start mysql I logs me in as '@localhost'
mysql> select user();
+-----------------------+
| user() |
+-----------------------+
| username@localhost |
+-----------------------+
1 row in set (0.00 sec)
mysql> select current_user();
+----------------+
| current_user() |
+----------------+
| @localhost |
+----------------+
1 row in set (0.00 sec)
mysql> CREATE DATABASE ign;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'ign'
I even try running this to log into my sql.
mysql -u username -p
Enter password:
ERROR 1045 (28000): Access denied for user 'username'@'localhost' (using password: YES)
I am so lost and any help would be greatly appreciated.
Upvotes: 0
Views: 4703
Reputation: 4544
If you just installed it and do not know the root password, or are unsure of the password, try resetting the root password (assuming you have admin rights on the machine). Then create a user and apply the applicable grant permissions.
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');
Upvotes: 3