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.
Related
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.
I created a schema and granted its permission to a specific user:
GRANT ALL PRIVILEGES ON USED_CARS.* TO ANDREW#LOCALHOST;
The database is created with root user and then granted these permissions to another user. now when I swith to another account I can list the schema with SHOW SCHEMAS; query however cannot switch to that DB with use USED_CARS; query.
Following error pops up:
ERROR 1044 (42000): Access denied for user 'ANDREW'#'localhost' to database 'USED_CARS'
What am I missing here? Thanks for the help in advance.
Sometimes depending on the configuration of server, you can use localhost or the ip:127.0.0.1
Could you try with this ...
GRANT ALL PRIVILEGES ON USED_CARS.* TO 'ANDREW'#'%';
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.
I have been trying to connect a REST api to a mysql db. I can do this over localhost but when I try to give access to a host IP I get an error about permission denied. After researching things it seems the solution to this is create a new user and grant access to localhost and the IP like so in the mysql shell... (There should only be one * before the . Stack wouldn't let me pot it correctly)
CREATE USER ‘Name’#’localhost’ IDENTIFIED BY ‘password’;
GRANT ALL PRIVILEGES ON **.* TO ‘Name’#’localhost’ WITH GRANT OPTION;
CREATE USER ‘Name’#’IP’ IDENTIFIED BY ‘password’;
GRANT ALL PRIVILEGES ON **.* TO ‘vScopeUserName’#’IP’ WITH GRANT OPTION;
FLUSH PRIVILEGES;
When I enter the first command I get this error:
ERROR 1146 (42S02): Table 'mysql.role_edges' doesn't exist
I can't find much info on this, if anyone knows anything or has suggestions it is much appreciated. Also I'm using Node.js on Ubuntu 18.04
I'm getting a very strange error, I've created a user 'testuser' with the following credentials:
CREATE USER 'testuser'#'%' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON *.* TO 'testuser'#'%';
FLUSH PRIVILEGES;
I have also modified my /etc/mysql/my.cnf not to bind to any single address. (Which afaik should accept connections from anywhere?) And restarted mysql.
And I can connect locally no problem.
I am running inside a virtual box on ubunutu.
Trying to connect from my windows machine, gives me MySQL error number 1045 Access denied for user 'testuser'#'192.168.0.22'.
I'm confident that it's not a networking problem as changing the host or port gives a different error "Cannot connect to the specified instance"
Logging in as root and looking at the users table - all looks as expected. (Single row, '%' for host and all permissions set.)
I've been banging my head against the wall all afternoon... can anyone suggest any other possible causes for this error?
Thanks for any help.
Run the GRANT statement with the IDENTIFIED BY:
GRANT ALL PRIVILEGES ON *.* TO 'testuser'#'%' IDENTIFIED BY '123456';