MySQL GRANT NDB_STORED_USER all users - mysql

I am trying to grant MySQL GRANT NDB_STORED to all users - this is the command to the single user
GRANT NDB_STORED_USER ON . TO 'wp_gmvgw'#'%';
I have tried different things but getting "ERROR 1410 (42000): You are not allowed to create a user with GRANT"
what i think i need is a script to list users and run the command to each user.
Any help would be amazing.
Thank you.

Related

How to grant user privileges in google cloud using mysql?

I have been trying to drop some of my views in my google cloud database
I ran into this error:
ERROR 1227 (42000) at line 74225: Access denied; you need (at least one of) the SYSTEM_USER privilege(s) for this operation
Based on this document: https://www.labnol.org/code/revoke-grant-permissions-mysql
I ran this query SHOW GRANTS FOR root and I got
'GRANT USAGE ON *.* TO `root`#`%`'
'GRANT `cloudsqlsuperuser`#`%` TO `root`#`%`'
I tried to revoke privileges with this command REVOKE ALL PRIVILEGES, GRANT OPTION FROM root but again I ran into another error 'Error Code: 1269. Can't revoke all privileges for one or more of the requested users'
Is there any solution for how can I grant the user privileges in order to drop tables?
Did I miss something in these commands?
Could you please confirm if you altered the users on that instance before?
Also, could you try to do this on a fresh instance, to see if you get the same behavior.
Create a totally new, fresh database instance with v5.7.
Connect to the database as root#%.
Run the Insert/Delete/Drop query and see.

Allowing Users To create databases with permissions for themselves only

I need for my users to create databases that only they can select,add,drop tables to.
I saw this Post which is exactly what I need but when I run command as
GRANT ALL PRIVILEGES ON `testuser\_%` . * TO 'testuser'#'LOCALHOST';
I get error
ERROR 1141 (42000): There is no such grant defined for user 'testuser' on host 'localhost'
I googled error and tried Flush Privileges but still get error. Any suggestions welcomed. I am running Ubuntu 16.4 w/mysql 5.7.32-0ubuntu0.16.04.1. Thanks.

Mysql workbench Error 1044 / 1142: Access / Grant command denied to user ''#'localhost' for

I work on a Mac OSX 10.6.8, and I use Mysql Workbench to learn how to handle databases (I'm a beginner as far as databases go). Now, I have created a few users, and I'm trying to toy around with giving these users' rights, and let them interact with each other by granting and revoking each other various rights.
I have logged in via the root user and supposedly given all "toy users" their initial rights by using the necessary grant queries (verified via queries using "show grants"), but then I try to log in as the various users. Let's say two of these users are named "Sofia" and "Martin", and I want Sofia to give Martin the update- and insert-rights to a table "Book". Sofia was given the necessary privileges from my root-login unless I am mistaken, so I write (when logged in as Sofia)
grant update, insert on Book to Martin;
This yields the error
Error 1142: GRANT command denied to user ''#'localhost' for table
'book'
Further, I try to figure out what rights Sofia does have, and enter the following query
show grants for Sofia;
when logged in as Sofia. The response:
Error 1044: Access denied to user ''#'localhost' for database 'mysql'
What is this mysterious ''#'localhost' user the errors are talking about? What should I do to make things work?
grant update, insert on Book.* to `Martin`#`%`;
please click edit to see the back-ticks
See the MySQL manual page on SHOW GRANTS

Information_Schema broke after moving SQL Database

A few weeks ago I had some problem moving my MySQL database. I copied it from one server to another. Now there is something wrong with the privileges.
I can create users, databases etc when logged in as root, but I can't change users privileges, which is not good as I don't want to give my script route access.
The error I get is ..
GRANT ALL PRIVILEGES ON `newdatabase` . * TO 'newuser'#'localhost' WITH GRANT OPTION ;
MySQL said:
#1044 - Access denied for user 'root'#'%' to database 'newdatabase'
So I did some reading and it appears my information_schema might be bust. The suggestions were to run flush tables on there which I have done via phpmyadmin and mysqladmin but this hasn't helped.
Any ideas?
Thanks
Possible root cause:
GRANT fails, because root#% does not have all privileges on newdatabase.*.
In short, you can only grant privileges you have in the first place.
This has nothing to do with the information schema.
Check which privileges root#% has.

Privileges issue

I have a mysql database (version 5.5), and I am trying to add a new user.
But I don't have the privileges to create it.If I try to show the list of all users:
select * from mysql.user;
It gives this error:
ERROR 1142 (42000): SELECT command denied to user ''#'localhost' for table 'user
It seems like I am not able to do anything.How to grant the privileges for a user without using the grant command?
There's a way? I also tried this:
CREATE USER 'ramy'#'localhost' IDENTIFIED BY 'pass';
It says:
ERROR 1227 (42000): Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation
I don't see any way to handle privileges, mysql show have a method to handle privileges for who have newly created a database.That's a vicious circle.
You need to login as the 'root' account
See this if you don't know the root password
http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html