Skip to content

Instantly share code, notes, and snippets.

@samuelloza
Created May 23, 2018 21:32
Show Gist options
  • Select an option

  • Save samuelloza/7c8c3aebb10a9b3e3fb24560f72f7329 to your computer and use it in GitHub Desktop.

Select an option

Save samuelloza/7c8c3aebb10a9b3e3fb24560f72f7329 to your computer and use it in GitHub Desktop.
Mysql FEDERATED
mysql FEDERATED es un link de una tabla a otra tabla remota,
no es bueno usar si se tienen muchos datos.
Si son pocos pues aquí la solución a menos que quieras construir un script de sincronización y ponerlo en un crontab
-- Tabla con conexion a una base de datos remota
CREATE TABLE tabla_remota
(
id INT NOT NULL AUTO_INCREMENT,
campo1 VARCHAR(32),
campo2 INT,
PRIMARY KEY (id),
INDEX campo1 (campo1)
)
ENGINE=FEDERATED
DEFAULT CHARSET=utf8
CONNECTION='mysql://usuario:contraseñ[email protected]/base_datos/tabla';
http://www.latindevelopers.com/ivancp/2011/11/activar-federated-mysql/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment