#1142 - INSERT command denied to user ___ for table ___ - mysql

Apparently this is usually to do with size, but I only have one table with six columns.
The only thing that has changed recently is that today I installed a forum but I've removed it again and the problem persists.
I am entering the SQL manually in PHPmyAdmin.
Any idea what the problem could be?

I just faced that ERROR, and found that my QUERY state incorrect spelled DATABASE name. :(

The problem is about the user session cookies, so all you need to do is to delete those cookies by clicking on the icon at the top right below phpMyAdmin as mentioned in this mage:

Your user doesn't have INSERT privilege. Check user database privileges.
Maybe you changed user, maybe you just changed the HOST or the IP from where you are connecting.
Use this statement to grant the privilege.
GRANT INSERT ON databaseName TO 'user'#'66.40.52.21'

Related

MySQL ERROR 1396 (HY000): Operation DROP USER failed for 'username'#'localhost'

The software im using automatically creates 2 mysql users during installation. Because of a slight issue those users were created wrongly and the Support advised me to remove the users form the database and then recreate them using the installer (theres a separate option to just create the database users).
The two users are 'username'#'localhost' and 'username'#'%' (yes, they have the same username on different hosts..)
My problem is that neither DROP USER 'username'#'localhost'; nor DROP USER 'username'#'%'; work, both throw an ERROR 1396.
My guess would be that it has to do with the user accounts "owning" elements in the database which would be orphaned. Is there a way to get past this and remove the users anyways? (Since they are gonna be recreated in a second?)
Clarification: Im using the mysql root user.
Ergest Basha's suggestion in this comment worked for me:
You could try deleting from mysql database. use mysql; then delete from user where user='username' and host ='localhost';

Phpmyadmin and column level privileges

I'm using column level privileges on some tables, but theese tables are unusable with phpmyadmin browse feature, because he execute SELECT * ... query, and this occurs SELECT command denied to user ... error. How can i solve this?
I've opened a ticket about this at https://github.com/phpmyadmin/phpmyadmin/issues/11922 but I'm not sure how feasible it is to fix. You can follow the discussion there for more information.

Why does SQL foribben to execute SELECT query?

I try to execute query in phpmyadmin and get error:
#1142 - SELECT command denied to user 'cpses_tkdpmnyjWW'#'localhost' for table 'user'
So, user cpses_tkdpmnyjWW'#'localhost is created dynamically and I can not set privileges for this user.
How to fix this?
Use SHOW GRANTS to show your current user privileges. It sounds as though the output may be similar to:
GRANT USAGE ON *.* TO 'Unnamed'#'localhost'
This would mean the account could sign into the server but do little else. This page gives a more detailed breakdown, as you'll see there are quite a few permutations.
The solution is you need to either find an account with more privileges or create/update one.
If the above is not an option, one quick trick I may try is connecting to '127.0.0.1' instead of 'localhost'. In MySQL the source of the connection can form part of the username so it's plausible that connecting on an IP instead of socket if you are on Unix flavoured OS.
Additionally, if you have admin/root access to the server, it is possible to create users when MySQL starts which is very useful in some scenarios.

Followed adwice for err 1045 but new problems Have made Grant statement too

wamp local
Lost contact with all dbases except one which I can log in to. In that DB my password is on a databas level and not a grant user. I have checked all earlier answers. First I did get error 1045 and took the advice given to use "cookie" instead of config in phpmyadmin config.inc
Logged in to phpmyadmin and got two other errors
needs a secret blowfish..??
Something wrong in config file. Doesn't say which and no more info
Fixed them(realy dont know how)
Have made The grant privileges statement for root.
Now I can come in with root user bud also every other user with or without password.
Then I can see my databases and tables(only titles)
I have checked that my DB files are still under the folders(msql bin data)
Got a message Before about something wrong in the config file. Checked it several times(config.inc.php) without seeing anything suspect.
Please... What to do?
I'm not really sure what your question is. It sounds like you worked through items 1 and 2. Sounds like you're logging in as root (as expected) and as the anonymous user (that's "every other user with or without password"). You can restrict that by removing the anonymous user (log in as root and click on the Users tab).

phpmyadmin privileges only working on some databases

When I use PHPMyAdmin to edit or delete a record I am getting an error saying "You don't have permission to access /phpmyadmin/sql.php on this server." But this only happens in some databases. I am the only user according to PHPMyAdmin and through the command prompt on my Linux box.
First off I've changed the PHPMyAdmin access folder because my access logs were showing others trying to get in. Logs don't show any successful attempts.
It was working until today...Now it throws the error. I can still add and drop tables completely, just not edit a record, in two of the five databases. Also I've checked into the user privileges and there doesn't seem to be an issue there.
Anyone have an idea?
EDIT: I have narrowed this down to a conflict between mod_security and PHPMyAdmin, now off to Google to find the solution,
Thanks
What I did was I opened modsecurity.d/modsecurity_crs_47_common_exceptions.conf and added the following to the bottom:
SecRuleEngine Off
And viola it fixed all the issues