I have a user in MySQL with the following privileges:
GRANT USAGE ON *.* TO 'certain_db'@'192.168.1.1' IDENTIFIED BY PASSWORD '****'
GRANT ALL PRIVILEGES ON `certain_db`.* TO 'certain_db'@'192.168.1.1'
If I drop this database, do I maintain the right to create it afterwards?
We can drop the database using the SQL command DROP DATABASE that completely and permanently deletes the database and all the contents of that database. Hence, we should be careful while using this command as it is not possible to restore the dropped database if you don't have any backup of it.
Deleting a MySQL or MariaDB database First list all databases on your server. Use the command 'SHOW DATABASES;' in the mysql-console like in the example above. Now copy the name of the database you want to delete. To do delete a database you need the command 'DROP DATABASE'.
To revoke all privileges, use the second syntax, which drops all global, database, table, column, and routine privileges for the named users or roles: REVOKE ALL PRIVILEGES, GRANT OPTION FROM user_or_role [, user_or_role] ... REVOKE ALL PRIVILEGES, GRANT OPTION does not revoke any roles.
Use the DROP Statement to Remove a Table. To permanently remove a table, enter the following statement within the MySQL shell: DROP TABLE table1; Replace table1 with the name of the table you want to delete.
Yes. All information related to user access, privileges, etc is stored in a database named 'mysql'. Information related to database privileges is stored in table 'db'. When you drop a database your privileges over it are not deleted. So, if you want to create a database with the SAME name later you will be able to.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With