What Happens If You No CREATE Privilege in a Database

Q

What Happens If You No CREATE Privilege in a Database? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements

✍: FYIcenter.com

A

In order to create tables in a database, your user account must have the CREATE privilege for that database. Otherwise you will get an error as shown in the following tutorial exercise:

>cd \mysql\bin
>mysql -u guest -ppub

mysql> use fyi;
Database changed

mysql> CREATE TABLE test (id integer);
ERROR 1142 (42000): CREATE command denied to user 
   'guest'@'localhost' for table 'test'

If you get this error, you need to see the DBA to obtain the CREATE privilege.

2007-05-11, 4725👍, 0💬