MYSQL - copy table error / user permission error - mysql

I'm trying to copy a table from one database to another and I keep getting errors. I'm not sure which one to troubleshoot specifically or if I'm even going in the right direction. Any ideas?
CREATE TABLE _pw_users.items LIKE _users.items;
INSERT INTO _pw_users.items SELECT * FROM _users.items;
And I get this error:
CREATE command denied to user 'xxxxxx'#'localhost' for table 'items'
So I try to allow permissions with this:
GRANT ALL PRIVILEGES ON `_pw_users`.* TO 'xxxxxx'#'localhost'
And I get this error:
"#1044 - Access denied for user 'xxxxxx'#'localhost' to database '_pw_users' "
I'm not sure where I should go from here.

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

#1227 - Access denied; you need the SUPER privilege for this operation - how to solve?

I am trying to change a SQL Variable through phpMyAdmin, and I get this error:
#1227 - Access denied; you need (at least one of) the SUPER privilege(s) for this operation
Trying to solve this error has led me to this question here on StackOverflow. Unfortunately all of the proposed solutions do not seem to work for me:
Go to PHPMYADMIN > privileges > Edit User > Under Administrator tab Click SUPER. > Go
As you can see from the screenshot above, there is no "privileges" tab in my phpMyAdmin.
mysql> GRANT SUPER ON . TO user#'localhost' IDENTIFIED BY 'password';
When I try to execute code like this, I get further errors:
Access denied for user 'cpses_ajceej5cb1'#'localhost'
I have never heard of this cpses... user before, they certainly don't seem to exist anywhere. Here is a screenshot of the issue:
Given all of these set backs, how can I change a variable in phpMyAdmin?
In the end the only way I could edit these variables wasn't through phpMyAdmin at all - I had to alter them through cPanel.

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

MySQL "CREATE USER" on PythonAnywhere

I'm connecting with my MySQL database using my user and host listed in Databases tab. No problems with that.
But I want to create a new user for that database (the user that I will use to my app connect with the database), but when I tried CREATE USER statement, I got a permission error:
ERROR 1227 (42000): Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation.
What I can do to accomplish that?
Thanks in advance.

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