Cannot assign table rights to a user

I have a user I want to assign rights to only use a certain a table in mysql. I log in as the main user account who has full rights but it does not let me assign table rights to this user. Any ideas?

Error

SQL query: DocumentationEdit Edit

GRANT SELECT ON mytable . * TO ‘coder’@‘localhost’;

MySQL said: Documentation
#1044 - Access denied for user ‘admin’@‘localhost’ to database ‘crowd’

Ensure that you are actually connecting in using the admin account with those credentials. After that, it becomes an issue for grant rights for the admin account. Try giving admin the proper grant rights before using it to change ‘coder’ users rights. The root account has full grant rights, your admin account seems to not.

If you are on a shared host it’s unlikely they’ll give you GRANT privileges.
The best you can do is limit what you can.

Hey!

He is asking the question on the localhost as we can see clearly from the post

If the database is on the same server as the hosting account then it is localhost. It can be any type of hosting account and so could be shared hosting just as easily as any other type.

Yeah you are right database and host file on the same server is termed localhost. But here is clearly see he is using the things as test purpose before going live. Also I believe that most of the service provider separate the database from the host so they lies on different servers. am i wrong?

Thanks Guys, I have a dedicated server

Also I am connecting with admin with the correct credentials

I see I do not have Grant rights and it does not let me assign these rights to admin

SQL query:

GRANT ALL PRIVILEGES ON * . * TO ‘admin’@‘localhost’ WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;

MySQL said: Documentation
#1045 - Access denied for user ‘admin’@‘localhost’ (using password: YES)

Your trying to grant rights with an account that does not have rights. You have to do it with root. As said before, if your on a machine that is not your own (a shared host) then you will most likely not get these grant rights added to admin.

Thanks, this is my server, I have a dedicated server so I have root access. When this was setup I did not have a root user created in mysql (I don’t know why). Admin is the
highest level. Does anyone know how I can assign grant access to admin. I can login SSH?

Since you own the box:

https://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html

I have created a root user and I know the password, but it does not have any Grant rights and everything I have tried to give root Grant rights is not working, any ideas?