Αποτελέσματα Αναζήτησης
28 Φεβ 2009 · As of MySQL 5.7 you can directly use DROP USER IF EXISTS statement. https://dev.mysql.com/doc/refman/5.7/en/drop-user.html DROP USER IF EXISTS 'user'@'localhost';
DROP USER [IF EXISTS] user [, user] ... The DROP USER statement removes one or more MySQL accounts and their privileges. It removes privilege rows for the account from all grant tables. Roles named in the mandatory_roles system variable value cannot be dropped.
In MySQL 5.7.8+, you can use the IF EXISTS clause to conditionally drop a user only if it exists: DROP USER [IF EXISTS] account_name [,account_name2]...; Code language: SQL (Structured Query Language) (sql) Besides removing the user account, the DROP USER statement also removes all privileges of the user from all grant tables. MySQL DROP USER ...
16 Ιουν 2010 · MySQL lacks DROP USER IF EXISTS construct. A good workaround is to grant a harmless privilege to the user before dropping it. This will create the user if it doesn't exist, so that it can be dropped safely, like so: GRANT USAGE ON *.* TO 'username'@'localhost'; DROP USER 'username'@'localhost'; FLUSH PRIVILEGES; USAGE actually means no privilege.
10 Σεπ 2024 · In MySQL, the DROP USER statement is used to delete an existing user account from the MySQL server. When a user is dropped, all the privileges assigned to that user are automatically revoked and the user can no longer log into the MySQL server.
DROP USER [IF EXISTS] user [, user] ... The DROP USER statement removes one or more MySQL accounts and their privileges. It removes privilege rows for the account from all grant tables. Roles named in the mandatory_roles system variable value cannot be dropped.
DROP USER [IF EXISTS] user [, user] ... The DROP USER statement removes one or more MySQL accounts and their privileges. It removes privilege rows for the account from all grant tables.