Cómo agregar motor federado después de instalar MySQL
-
16-10-2019 - |
Pregunta
Tengo mysql 5.5.18
y en los motores de exhibición:
show engines; +--------------------+---------+------------------------------------------------------------+--------------+------+------------+ | Engine | Support | Comment | Transactions | XA | Savepoints | +--------------------+---------+------------------------------------------------------------+--------------+------+------------+ | InnoDB | DEFAULT | Supports transactions, row-level locking, and foreign keys | YES | YES | YES | | PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO | | MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO | | CSV | YES | CSV storage engine | NO | NO | NO | | MyISAM | YES | MyISAM storage engine | NO | NO | NO | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | +--------------------+---------+------------------------------------------------------------+--------------+------+------------+
Como ve, el motor federado no es uno de la lista. ¡Necesito habilitarlo! ¿Alguna idea de por qué faltan los motores Blackhole, Federated y Archive de la lista? y como puedo Agregar/Habilitar ¿a ellos?
EDITAR
Tengo Ubuntu 11.10 e instalé MySQL desde PPA ... He agregado lo siguiente a /etc/apt/sources.list
deb http://ppa.launchpad.net/nathan-renniewaldock/ppa/ubuntu oneiric main deb-src http://ppa.launchpad.net/nathan-renniewaldock/ppa/ubuntu oneiric main
Gracias por tu ayuda
Solución
He logrado encontrar una solución ...
ya hay un complemento disponible en
/usr/lib/mysql/plugin/ha_federated.so
Acabo de iniciar sesión en MySQL como root y ejecuto la siguiente consulta
mysql>install plugin federated soname 'ha_federated.so';
Luego agregué Federated a my.cnf y reinicié mysql
Otros consejos
Si la instalación predeterminada/instalación binaria
En mi opinión el BLACKHOLE , ARCHIVE
están instalados y habilitados de forma predeterminada cuando instala el servidor MySQL.
pero el FEDERATED
no está habilitado de forma predeterminada.
Puede habilitarlo manualmente que ha editado su archivo my.cnf.edit my.cnf y en la sección [mysqld], agregue la línea:
federated
Ahora reinicie el servidor MySQL.
Para añadir Archive
Ir a Link http://timanovsky.wordpress.com/2010/10/09/enabling-archive-storage-ingine-in-ius-mysql-5-1/
Si ha instalado desde la fuente, se suponía que debía hacer así:
Para Blackhole: invocar configurar con el --with-blackhole-storage-engine
opción.
Para Archieve: invocar configurar con el --with-archive-storage-engine
opción
Para federado: invocar configurar con el --with-federated-storage-engine
opción
Sé que la publicación es un poco vieja, pero parece que muchas personas tienen problemas con los motores federados.
Cuando los binarios MySQL se instalan a través de YUM, ya tiene los complementos HA (alta disponibilidad). Simplemente necesita cargar los complementos dentro de la CLI MySQL.
Aquí está el proceso básico:
Comience MySQLD si aún no se ha iniciado. Asegúrese de que 'federado' no esté en /etc/my.cnf en este punto.
Ej: En este momento, /etc/my.cnf se verá así desde una instalación YUM estándar ....
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
Inicie sesión en la CLI MySQL con raíz (u otra cuenta con privilegio suficiente).
Escribe: show engines;
No debería ver ningún motor federado en este momento, como este:
mysql> show engines;
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| CSV | YES | CSV storage engine | NO | NO | NO |
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO |
| InnoDB | YES | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
5 rows in set (0.00 sec)
Para habilitar el motor de federación, escriba lo siguiente:
install plugin federated soname 'ha_federated.so'
Ahora, cuando 'muestres motores' verás el motor federado, pero apagado ...
Se verá así:
mysql> show engines;
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL |
| CSV | YES | CSV storage engine | NO | NO | NO |
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO |
| InnoDB | YES | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
6 rows in set (0.00 sec)
Ahora puede agregar de forma segura la línea 'federada' al archivo /etc/my.cnf como este:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
federated
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
Reiniciar mysqld (servicio MySQLD reiniciar, etc ...)
Después del reinicio, regrese al MySQL CLI.
Escribe show engines;
Ahora debería ver el motor federado disponible y con soporte como sí.
mysql> show engines;
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| FEDERATED | YES | Federated MySQL storage engine | NO | NO | NO |
| CSV | YES | CSV storage engine | NO | NO | NO |
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO |
| InnoDB | YES | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
6 rows in set (0.00 sec)
Y terminaste ... ve y crea tablas de federación ...
¡Buena suerte!
Envíeme un correo electrónico con cualquier pregunta ... feliz de ayudar.
En ML con el MySQL 5.5 (actual) todo lo que tenía que hacer era:
- Copie uno de los archivos existentes de/usr/local/mysql/soporte-film/to /etc/my.cnf
- Agregue 'Federado' (sin cotizaciones) a la sección [MySQLD] (no el final del archivo my.cnf)
- Reiniciar mysql
Esto también podría ser útil para aquellos que desean una forma automatizada de declarar tablas: http://sylnsr.blogspot.com/2012/11/auto-constructing-ddl-for-mysql.html