- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Creating and Selecting a MySQL Database
152 Lectures 16 hours
87 Lectures 5.5 hours
Creating a Database
A database can be created using the below statement −
CREATE DATABASE databaseName;
CREATE DATABASE STUDENT
Selecting a MySQL Database
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.
- Creating and Using a MySQL Database
- Selecting random entry from MySQL Database?
- How to check statement of creating a particular MySQL database?
- Fix ERROR 1064 (42000) while creating a database in MySQL?
- Selecting database inside the JS in MongoDB?
- Selecting a single row in MySQL?
- Creating Database Table in Python
- Selecting Random Result from MySQL?
- MySQL: selecting rows where a column is null?
- Selecting and displaying only some rows from a column in a MySQL table
- Creating a MySQL Docker Container
- Example of creating a database view in SAP HANA
- Selecting a column that is also a keyword in MySQL?
- Creating column table in SAP HANA database
- Refreshing a schema after creating a table in SAP HANA database