To create a MySQL user called "admin" with the password "asterisk" and grant all privileges to the "asterisk" database, as well as allow remote MySQL connections, follow these steps:
- Log in to the MySQL server as the root user: css- mysql -u root -p
- Enter the MySQL root password when prompted. 
- Create a new user "admin" with the password "asterisk": sql- CREATE USER 'admin'@'%' IDENTIFIED BY 'asterisk';- This creates a user named "admin" that can connect from any remote host ("%"). 
- Grant all privileges to the user on the "asterisk" database: sql- GRANT ALL PRIVILEGES ON asterisk.* TO 'admin'@'%';
- Flush the privileges to apply the changes: sql- FLUSH PRIVILEGES;
Allow remote connection
nano my.cnf.d/mariadb-server.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mariadb/mariadb.log
pid-file=/run/mariadb/mariadb.pid
bind-address=0.0.0.0
Restart the service
 systemctl restart mysqld
TEST
 mysql -h 145.27.107.195 -u admin -pasterisk
 
No hay comentarios:
Publicar un comentario