Link to home
Start Free TrialLog in
Avatar of Brad Jones
Brad Jones

asked on

mysql 8 create permissions for all users syntax

GRANT EXECUTE ON adminAA.* to '*'@'%';

returns error
Error Code: 1410. You are not allowed to create a user with GRANT      0.016 sec
delimiter $$

CREATE DATABASE `adminAA` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_bin */ /*!80016 DEFAULT ENCRYPTION='N' */$$
use adminAA$$
DELIMITER $$
drop function if exists afSlaveStatus$$
Create function afSlaveStatus()
RETURNS varchar(25)
begin
  Return(
   SELECT SERVICE_STATE FROM performance_schema.replication_applier_status
  );
end$$

GRANT EXECUTE ON `adminAA`.* to '*'@'%'$$

Open in new window

Avatar of noci
noci

Does the user '*' exist?....


Grant can only be used on existing accounts.

One cannot create a user using a GRANT command.

It also needs an identified by clause for a new user.


(mariadb gives a different error though:   ERROR 1133 (28000): Can't find any matching row in the user table )

Avatar of Brad Jones

ASKER

It is unfortunate we cannot add a function and make it available to all users on the server without adding the permission to each user.

It isn't a common use to have many users in a database. 

Mostly applications are the users...  and several application access the database using those credentials.

(most common use; Web sites,.. etc.) The facebook database may only have one username to access the database and procedures. + a few for DBA's.

(i have no internal knowledge... maybe there are a few for several applications like Facebook, whatsapp, ...)


YMMV obviously. 



This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.