The first step is to install mariadb-server
sudo apt install mariadb-server
The second step is to check the running status of mariadb
service mariadb status
The status is shown in the figure below:
The third step is to set up the database
sudo mysql_secure_installation
The fourth step is to log in to the database
The fifth step is to configure permissions
Configure common user remote login:
// username为用户名 password为用户密码
create user username@'%' identified by 'password';
//刷新权限
flush privileges;
Configure common user remote login:
//username为用户名 password为用户密码
create user username@localhost identified by 'password';
//刷新权限
flush privileges;
Configure root privileges for users for remote login
// 配置root权限 username为用户名,password为用户密码
grant all on *.* to username@'%' identified by 'password' with grant option;
//刷新权限
flush privileges;
The sixth step is to configure remote login
open configuration file
sudo vim /etc/mysql/mariadb.conf.d/50-server.cnf
Comment out bind-adderss
and restart the database
systemctl restart mariadb.service
Step 7: DBeaver connects to the database
Enter the IP address, user name, and password of the Raspberry Pi, and then you can connect.
After the connection is successful, the following figure is shown:
reference link
https://blog.csdn.net/qq_38070370/article/details/126534433