How to use MariaDB after installing it?

After installing MariaDB, you can use it by following these steps:

  1. Start the MariaDB service by entering sudo systemctl start mariadb in the command line (Linux) or net start mariadb in Windows.
  2. Login to MariaDB: Enter the command mysql -u username -p in the command line, and then enter the password to log in to MariaDB.
  3. To create a database: After successfully logging in, you can use the following command to create a database: CREATE DATABASE database_name;
  4. Choose database: Use the following command to select the database you want to use: USE database name;.
  5. To create a table: in the selected database, you can use the CREATE TABLE command to create a table, specifying the names and types of each field.
  6. Inserting data: Use the INSERT INTO command to add data to a table.
  7. Retrieve data: Use the SELECT command to retrieve data, for example SELECT * FROM table_name;
  8. Update data: To update data, use the UPDATE command, for example UPDATE table_name SET field_name = new_value WHERE condition;.
  9. Delete data: Use the DELETE command to remove data, for example DELETE FROM table_name WHERE condition;.
  10. Update user password: Use the ALTER USER command to change the user password, for example ALTER USER username IDENTIFIED BY ‘newpassword’;.

These are the basic usage instructions for MariaDB, which can be further studied and understood as needed.

bannerAds