I have strange error. I am logged in local Mysql as root via command line. After creating database:
create database some_db;
Then giving privileges to some user:
grant all privileges on some_db.* to some_user@'localhost' identified by 'password';
This is giving error:
ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'some_db'
The permissions for the root(show grants;) shows:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*8919C53DC7A4DFBF3F8584382E96463583EB7FDA'
I am also making sure i am logged in as root:
select current_user();
And this confirms that i am logged in as 'root'@'localhost'
I have created database and assigned user multiple times and never had an issue. Why i am unable assign user to the database created by root while logged in as root?
p.s. from other posts, i am thinking the issue may be caused due to some strange users
select host, user from mysql.user;
Some users that i have not added but does show up:
MY_COMPuTER_name.local | ''
MY_COMPuTER_name.local | root
I tried to delete these users
drop user 'root'@'MY_COMPuTER_name.local';
drop user ''@'MY_COMPuTER_name.local';
However, while it states query run successful, the users are not dropped even after flush privileges. Why i am unable delete users? Any help is much appricated
GRANT
statement – SumpterGRANT OPTION
. For instance, my rootSHOW GRANTS
says:GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY ... WITH GRANT OPTION
. That last part is kinda important to be able to GRANT privileges ;) – Projection