How to use MariaDB after installing it?
After installing MariaDB, you can use it by following these steps:
- Start the MariaDB service by entering sudo systemctl start mariadb in the command line (Linux) or net start mariadb in Windows.
- Login to MariaDB: Enter the command mysql -u username -p in the command line, and then enter the password to log in to MariaDB.
- To create a database: After successfully logging in, you can use the following command to create a database: CREATE DATABASE database_name;
- Choose database: Use the following command to select the database you want to use: USE database name;.
- 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.
- Inserting data: Use the INSERT INTO command to add data to a table.
- Retrieve data: Use the SELECT command to retrieve data, for example SELECT * FROM table_name;
- Update data: To update data, use the UPDATE command, for example UPDATE table_name SET field_name = new_value WHERE condition;.
- Delete data: Use the DELETE command to remove data, for example DELETE FROM table_name WHERE condition;.
- 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.