Summery: This is a MariaDB Tutorial for Beginners.
Earlier we have learned How to install MariaDB on Ubuntu. In this article we are going to discuss some basic MariaDB commands that will help you to get started with using MariaDB. These commands can also be used with MySQL.
Checking the version of your MariaDB Installation
You can check the version of your MariaDB installation using the following command. First log into your Database. Since you’ve just installed MariaDB and you haven’t set a password for the root account, the password will be blank. There for use the following command and hit enter when you are prompt to enter a password.
msql -u root -p
After you logged in you can see your version highlighted in the welcome text.
How to View Databases in MariaDB
To view all the databases in your MariaDB server run,
How to Creating a New Database in MariaDB
Use the following syntax to create a new database in MariaDB.
create database <yourdatabsename>;
How to Use a Database in MariaDB
In order to use a database in MariaDB use the following command,
How to Delete Databases in MariaDB
You can delete a database or table using the following command
drop database <databasename>
How to create and view tables in MariaDB
You can use the show tables command to view tables in a database.
To create a table in database you can use the below syntax.
create table <tablename> (<filedname> <type>)
You can also use explain statement to get information about a table.
If you find any difficulties when handling MariaDB always look in their Knowledge Base.