1.安装
sudo apt install mariadb-server mariadb-client
2.启动&关闭&启动mysql
# service mysql start
# service mysql stop
# service mysql start
3.所装MySQL密码为空,添加密码
root@X-PC# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 49
Server version: 10.3.27-MariaDB-0+deb10u1 Debian 20
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [mysql]> UPDATE mysql.user SET authentication_string = PASSWORD('此处写自己要设置的密码'), plugin = 'mysql_native_password' WHERE User = 'root'