Problems with update in federated table

Asked

Viewed 132 times

0

I have a problem understanding a mistake when using a federated table.

Setting:

Server A: create view federated_view as SELECT ....

Server B: create table table_federated (A, B, C)

ENGINE=FEDERATED CONNECTION='mysql://user:paswd@:3306/database/federated_view';

When I perform an update in the federated table, locally on the B server, the execution of the command returns OK, no errors, but the value is not changed:

mysql> update tabela_federada set incidentes_utilizados = 1 where customer_id = 'teste' and incidentes_utilizados = 10;
Query OK, 1 row affected (0.17 sec)

mysql> select * from tabela_federada where customer_id = 'teste'\G
incidentes_utilizados: 10
     bugs_qualificados: 3
requisicoes_utilizadas: 2
     horas_disponiveis: 4.00
  • Talk commit update; after update give one commit; and check if you have updated the registration;

  • Even eating didn’t work

2 answers

0

You have already checked if the servers accessing the database are with all the necessary permissions?

Make sure you grant the necessary privileges over the ips accessing the Mysql server:

GRANT ALL PRIVILEGES ON nome_da_base_de_dados.* TO 'usuario'@'ip_servidor';

If you prefer you can use "%" instead of "ip_server" to grant permission to all ips (NOT PERMANENTLY RECOMMENDED), but for test purpose setting "%" temporarily can be a good suggestion, at least to confirm if it really is privilege problem (permission)

0

Thanks for the help received, I located the documentation concerning federated tables in Mysql, and what happened was that the view used to create the federated table has many aggregated functions, such as JOIN and therefore does not realize the update in the source table or in the federated table.

The output was to create a table on the server A from the view, and create the federated table from this new table on server A.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.