Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Install and Configure MariaDB on Linux

MariaDB is a popular open-source relational database management system (RDBMS) that is compatible with MySQL. It is a drop-in replacement for MySQL and offers improved performance, scalability, and security features. MariaDB is widely used in the Linux environment due to its seamless integration with the operating system and its ability to handle large amounts of data efficiently.

To install and configure MariaDB on Linux, follow these steps:

  1. Update the package manager:

    sudo apt update
  2. Install MariaDB server:

    sudo apt install mariadb-server
  3. Start the MariaDB service:

    sudo systemctl start mariadb
  4. Secure the MariaDB installation:

    sudo mysql_secure_installation

    This command will guide you through a series of prompts to set a root password, remove anonymous users, disallow remote root login, and remove test databases. It is recommended to answer "Y" to all the prompts for a secure installation.

  5. Verify the MariaDB service status:

    sudo systemctl status mariadb

    This command will display the current status of the MariaDB service.

  6. Access the MariaDB shell:

    sudo mysql

    This command will open the MariaDB shell where you can execute SQL queries and manage databases.

  7. Create a new database and user:

    CREATE DATABASE mydatabase;
    CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypassword';
    GRANT ALL PRIVILEGES ON mydatabase.* TO 'myuser'@'localhost';
    FLUSH PRIVILEGES;

    Replace "mydatabase", "myuser", and "mypassword" with your desired values.

  8. Exit the MariaDB shell:

    exit

    This command will exit the MariaDB shell and return to the Linux terminal.

Note: If MariaDB is not applicable in your Linux environment, a viable alternative is MySQL. MySQL is also an open-source RDBMS and offers similar features and compatibility with Linux systems. The installation and configuration steps for MySQL are quite similar to MariaDB.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.