install
#apt install mariadb-server
config
#mysql_secure_installation
- The first prompt will ask you to enter the current database root password. Since you have not set one up yet, press ENTER to indicate “none”.
- You’ll be asked if you want to switch to unix socket authentication. Since you already have a protected root account, you can skip this step. Type n and then press ENTER.
- The next prompt asks you whether you’d like to change the root password. On Debian 11, the root account for MariaDB is tied closely to automated system maintenance, so you should not change the configured authentication methods for that account.
Doing so would make it possible for a package update to break the database system by removing access to the administrative account. Type n and then press ENTER. - Later, you’ll go over how to set up an additional administrative account for password access if socket authentication is not appropriate for your use case.
From there, you can press Y and then ENTER to accept the defaults for all the subsequent questions. This will remove some anonymous users and the test database, disable remote root logins, and load these new rules so that MariaDB immediately implements the changes you have made.
setting akun
#mariadb
GRANT ALL ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit