After executing the following mysql statement to create database and giving privileges to user can’t access mysql
create database my_db;
GRANT ALL PRIVILEGES ON my_db.* TO 'user'@'%' IDENTIFIED BY 'mypasswd';
GRANT SELECT ON my_db.* TO 'user'@'%' IDENTIFIED BY 'mypasswd';
FLUSH PRIVILEGES;
mysql -u user -p mypasswd drops me
Access denied for user 'user'@'localhost'
There is no space between
-pand your password.As you granted rights only for the database
my_db, add the db also to connect directly to it.