-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmariadb
37 lines (24 loc) · 1.13 KB
/
mariadb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#####Resetear contraseña de root #######
walter@fsw:~$ /etc/init.d/mysql stop
walter@fsw:~$ /usr/bin/mysqld_safe --skip-grant-tables &
walter@fsw:~$ mysql --user=root mysql
mysql> update user set Password=PASSWORD('nuevo-password') WHERE User='root';
mysql> flush privileges;
mysql> exit
walter@fsw:~$ /etc/init.d/mysql start
walter@fsw:~$ mysql --user=root --pass=nuevo-password
mysql> exit
####Crear un usuario administrador para usar con phpmyadmin##############
walter@fsw:~$ mysql -u root
mysql> CREATE USER 'nuevo_usuario'@'localhost' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'nuevo_usuario'@'localhost';
mysql> FLUSH PRIVILEGES;
walter@fsw:~$ nano /etc/mysql/mariadb.conf.d/50-server.cnf
#bind-address = 127.0.0.1
walter@fsw:~$ exit
walter@fsw:~$ service mysql restart
walter@fsw:~$ netstat -tupan | grep mysql
#Para la version 8.0 además agregar si se desea acceder desde una red externa
ALTER USER 'nuevo_usuario'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
#https://stackoverflow.com/questions/49194719/authentication-plugin-caching-sha2-password-cannot-be-loaded
mysql> SET GLOBAL local_infile=1;