MariaDB debian 9.x launch: mysql_secure_installation #MariaDB on debian by default the root user has the plugin unix_socket enabled: #check auth: SELECT host,user,password,plugin FROM mysql.user; #remove (only) unix_socket plugin on mysql internal database UPDATE mysql.user SET plugin='' WHERE user='root'; FLUSH PRIVILEGES; quit; #Create user: CREATE USER ''username'@'domain'' IDENTIFIED BY 'password_in_chiaro'; FLUSH PRIVILEGES; #Grant privileges. As root user execute: GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON *.* TO 'root'@'my_ip' IDENTIFIED BY 'root_password' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root_password' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON *.* TO 'root'@'my_ip' IDENTIFIED BY 'root_password' WITH GRANT OPTION; SHOW GRANTS FOR 'username'@'domain'; #Create user: CREATE USER 'username'@'domain' IDENTIFIED BY 'password_in_chiaro'; GRANT ALL ON database.* TO 'username'@'domain'; FLUSH PRIVILEGES; #delete user; REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'username'@'domain'; DROP USER DROP USER; #set tcp access: /etc/mysql/mariadb.conf.d/50-server.cnf comment or edit: #bind-address = 127.0.0.1 or bind-address = 0.0.0.0 Il campo dominio (dopo @) puo' assumere i valori: localhost per indicare che l'utente puo' connettersi solo dalla macchina locale; % per indicare che l'utente puo' connettersi da qualunque IP; o altrimenti si puo' indicare la rete o l'IP per indicare che l'utente puo' connettersi da determinati IP;