Mysql

Da wiki.gienne.cloud.

MariaDB Configurazione di Base:

Configurare MySQL per accettare connessioni remote


Modifica configurazione di porta di ascolto: /etc/my.cnf.d nel file server.cnf

#
# Allow server to accept connections on all interfaces. 
#
bind-address=0.0.0.0


Riavvio del servizio:

service mysql restart


Verifica connection:

SELECT User, Host FROM mysql.user WHERE Host <> 'localhost';

Settaggio al mondo:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'orione' WITH GRANT OPTION;

grant all privileges on DBNAME.* to 'USER'@'HOST' identified by 'pwd' with grant option; grant all privileges on DBNAME.* to 'USER'@'HOST.DOMAIN' identified by 'pwd' with grant option;


Link:

https://www.pythian.com/blog/how-to-access-mysql-from-oracle-with-odbc-and-sql/


- MYSQL Oracle - 
wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.21-1.el7.x86_64.rpm-bundle.tar
Al primo riavvio recuperare la password temporanea:
sudo grep 'temporary password' /var/log/mysqld.log
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';


Rif: https://dev.mysql.com/doc/mysql-getting-started/en/#mysql-getting-started-installing
http://myoracleproduct.blogspot.it/2013/09/mysql-standby-creation-master-slave.html

InnoDB-Cluster

Spezzare un dump di multi DB

Duplicazione tabella


CREATE USER 'admin'@'%' IDENTIFIED BY 'password';



In MySQL you need to use the commands tee & notee:

tee data.txt;
//SQL sentences... 
notee;


Risoluzione errore nella replica:

STOP SLAVE;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
START SLAVE;
SELECT SLEEP(5);
SHOW SLAVE STATUS\G