Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
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:
Update the package manager:
sudo apt update
Install MariaDB server:
sudo apt install mariadb-server
Start the MariaDB service:
sudo systemctl start mariadb
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.
Verify the MariaDB service status:
sudo systemctl status mariadb
This command will display the current status of the MariaDB service.
Access the MariaDB shell:
sudo mysql
This command will open the MariaDB shell where you can execute SQL queries and manage databases.
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.
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.