Quelle create_or_replace_permission.result
Sprache: Lisp
set local sql_mode=""; set global sql_mode="";
#
# Tests for checking permission denied on CREATE ORREPLACEif DROP
# access is revoked
#
# These statements do not need special tests for CREATE ORREPLACE,
# because they do not have separate permissions for create and drop:
# CREATE ORREPLACE EVENT (uses EVENT_ACL for both CREATE and DROP)
# CREATE OR DROP SERVER (uses SUPER_ALC for both CREATE and DROP)
# CREATE OR DROP TRIGGER (uses TRIGGER_ACL for both CREATE and DROP)
SELECT CURRENT_USER;
CURRENT_USER
root@localhost
CREATE DATABASE db1;
GRANT ALL ON db1.* TO mysqltest_1@localhost;
REVOKE DROP ON db1.* FROM mysqltest_1@localhost;
REVOKE ALTER ROUTINE ON db1.* FROM mysqltest_1@localhost;
GRANT DELETE ON mysql.* TO mysqltest_1@localhost;
REVOKE DELETE ON mysql.* FROM mysqltest_1@localhost;
FLUSH PRIVILEGES;
connect user_a, localhost, mysqltest_1,,;
connection user_a;
SELECT CURRENT_USER;
CURRENT_USER
mysqltest_1@localhost
CREATE DATABASE db1; ERROR HY000: Can't create database 'db1'; database exists
CREATE ORREPLACE DATABASE db1; ERROR42000: Access denied for user 'mysqltest_1'@'localhost' to database 'db1'
CREATE ORREPLACE DATABASE db2; ERROR42000: Access denied for user 'mysqltest_1'@'localhost' to database 'db2'
USE db1;
CREATE ORREPLACE TABLE t1(id INT); ERROR42000: DROP command denied to user 'mysqltest_1'@'localhost' for table `db1`.`t1`
CREATE ORREPLACE PROCEDURE proc1 (OUT cnt INT) BEGIN END; ERROR42000: alter routine command denied to user 'mysqltest_1'@'localhost' for routine 'db1.proc1'
CREATE ORREPLACE FUNCTION lookup RETURNS STRING SONAME "UDF_EXAMPLE_LIB"; ERROR42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysql'
CREATE ORREPLACE FUNCTION hello(str char(20)) RETURNS TEXT RETURN CONCAT('Hello, ', str, '!'); ERROR42000: alter routine command denied to user 'mysqltest_1'@'localhost' for routine 'db1.hello'
CREATE ORREPLACE USER u1@localhost; ERROR42000: Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation
CREATE ORREPLACE ROLE developer; ERROR42000: Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation
connection default;
disconnect user_a;
SELECT CURRENT_USER;
CURRENT_USER
root@localhost
DROP DATABASE db1;
DROP USER mysqltest_1@localhost; set global sql_mode=default;
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-10-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.