A database can be created using the below statement −
CREATE DATABASE databaseName;
CREATE DATABASE STUDENT
If we wish to access and use a specific database, we can use the following query −
mysql> USE databaseName Database changed
The ‘USE’ statement doesn’t require a semi-colon. This is similar to the ‘QUIT’ statement. Even if semi-colon is used, it does no harm.
We can create and use a database of our own, but before that, MySQL administrator’s permission is required.
The MySQL administrator can execute a command as shown below to provide permissions −
mysql> GRANT ALL ON tableName.* TO ‘your_mysql_name’@’your_client_host’;
Here, ‘your_mysql_name’ refers to the MySQL user name which is assigned to the user.
The ‘your_client_host’ refers to the host from which the user connected to the server.