Phpmyadmin and column level privileges - mysql

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.

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';

MySql SELECT command denied to user (Despite having all privileges)

Really lost on this one. Apparently this error text can be a red herring. Hoping to get some other eyes on this. I'm doing this as a user with specified privileges. When I try the commands as root, everything works just fine, so I've narrowed it down to permissions or an issue w/ the user.
Basically, I'm calling DELETE on a row. Pretty simple stuff.
DELETE FROM hits WHERE id IN(12345) AND userId = 1
That results in this error:
{ [Error: ER_COLUMNACCESS_DENIED_ERROR: SELECT command denied to user 'auctions'#'myhost' for column 'id' in table 'hits']
Okay, weird... I know the user has privileges. The following query returns a set of rows.
SELECT * FROM hits
At first the user had SELECT,INSERT,UPDATE,DELETE. Now I've just done GRANT ALL PRIVILEGES (from any host) but I get the same results. Here's what SHOW GRANTS shows
GRANT ALL PRIVILEGES ON `database`.`hits` TO 'auctions'#'%'
Yet, I still get this same error. As per before, running as root everything works just fine.
This is a node script calling the queries, but I've confirmed the behavior through PhpMyAdmin as well, so I will assume that's not to blame.
My version is 5.6.19

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.

Unhandled exception: Error creating account

I'm trying to set up a database with MySQL and this error keeps popping up: Unhandled exception: Error creating account blank#blank. Error executing 'Access denied; you need (at least one of)the create user privileges for this operation.
I'm wondering if and how I can change my own account settings so that I'll be able to add new users again and be able to do other things. The program I'm currently using for this is MySQL workbench and I recently put the server onto a Microsoft web-matrix website. I'm not completely sure if that can cause any odd effects but I just want to be safe. Thanks guys.
Create a new connection in MySQL workbench with user root. Logon with that user in MySQL workbench and go to a Query window. Assuming you want to access everything and have all privileges, issue the following SQL statement. Replace 'you' with your username.
GRANT ALL PRIVILEGES ON * . * TO 'you'#localhost;
GRANT ALL PRIVILEGES ON * . * TO 'you'#'%';
That will give you pretty much everything.
Here is the Documentation

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

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'