{"action":"created","issue":{"url":"https://api.github.com/repos/phpmyadmin/phpmyadmin/issues/11752","labels_url":"https://api.github.com/repos/phpmyadmin/phpmyadmin/issues/11752/labels{/name}","comments_url":"https://api.github.com/repos/phpmyadmin/phpmyadmin/issues/11752/comments","events_url":"https://api.github.com/repos/phpmyadmin/phpmyadmin/issues/11752/events","html_url":"https://github.com/phpmyadmin/phpmyadmin/issues/11752","id":122479247,"number":11752,"title":"4.5.2 breaks MySQL Master Master Cluster","user":{"login":"hE-rx","id":9462759,"avatar_url":"https://avatars.githubusercontent.com/u/9462759?v=3","gravatar_id":"","url":"https://api.github.com/users/hE-rx","html_url":"https://github.com/hE-rx","followers_url":"https://api.github.com/users/hE-rx/followers","following_url":"https://api.github.com/users/hE-rx/following{/other_user}","gists_url":"https://api.github.com/users/hE-rx/gists{/gist_id}","starred_url":"https://api.github.com/users/hE-rx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hE-rx/subscriptions","organizations_url":"https://api.github.com/users/hE-rx/orgs","repos_url":"https://api.github.com/users/hE-rx/repos","events_url":"https://api.github.com/users/hE-rx/events{/privacy}","received_events_url":"https://api.github.com/users/hE-rx/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/phpmyadmin/phpmyadmin/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-16T11:06:35Z","updated_at":"2015-12-17T15:15:00Z","closed_at":null,"body":"I have updated phpmyadmin from 4.2.12 to 4.5.2.\r\n\r\nI have configured a MySQL Master Master Replication and I can login on both nodes from phpmyadmin, here is the phpmyadmin config:\r\n/* Servers configuration */\r\n$i = 0;\r\n\r\n/* Server: hostname1 [1] */\r\n$i++;\r\n$cfg['Servers'][$i]['verbose'] = 'hostname1';\r\n$cfg['Servers'][$i]['host'] = '1.1.1.1';\r\n$cfg['Servers'][$i]['port'] = '3306';\r\n$cfg['Servers'][$i]['socket'] = '';\r\n$cfg['Servers'][$i]['connect_type'] = 'tcp';\r\n$cfg['Servers'][$i]['extension'] = 'mysqli';\r\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\r\n$cfg['Servers'][$i]['user'] = 'root';\r\n$cfg['Servers'][$i]['password'] = '';\r\n\r\n/* Server: hostname2 [2] */\r\n$i++;\r\n$cfg['Servers'][$i]['verbose'] = 'hostname2';\r\n$cfg['Servers'][$i]['host'] = '2.2.2.2';\r\n$cfg['Servers'][$i]['port'] = '3306';\r\n$cfg['Servers'][$i]['socket'] = '';\r\n$cfg['Servers'][$i]['connect_type'] = 'tcp';\r\n$cfg['Servers'][$i]['extension'] = 'mysqli';\r\n$cfg['Servers'][$i]['auth_type'] = 'cookie';\r\n$cfg['Servers'][$i]['user'] = 'root';\r\n$cfg['Servers'][$i]['password'] = '';\r\n\r\n/* End of servers configuration */\r\n\r\n$cfg['blowfish_secret'] = 'somelongstring';\r\n$cfg['DefaultLang'] = 'en';\r\n$cfg['ServerDefault'] = 1;\r\n$cfg['UploadDir'] = '';\r\n$cfg['SaveDir'] = '';\r\n$cfg['VersionCheck'] = '0';\r\n$cfg['DisplayServersList'] = 'true';\r\n$cfg['VersionCheckProxyUrl'] = 'http://proxy.domain:8080'\r\n\r\nAfter the update, my SLAVE on hostname2 breaks with the following errors:\r\n\r\nLast_Error: Error 'Duplicate entry 'pma_test_host-mysql-pma_test_user' for key 'PRIMARY'' on query. Default database: ''. Query: 'INSERT INTO `mysql`.`db`(`host`, `Db`, `User`) VALUES(\"pma_test_host\", \"mysql\", \"pma_test_user\")'\r\n\r\nLast_Error: Error 'Duplicate entry 'pma_test_host-mysql-pma_test_user--' for key 'PRIMARY'' on query. Default database: ''. Query: 'INSERT INTO `mysql`.`columns_priv`(`host`, `Db`, `User`, `Table_name`, `Column_name`) VALUES(\"pma_test_host\", \"mysql\", \"pma_test_user\", \"\", \"\")'\r\n\r\nLast_Error: Error 'Duplicate entry 'pma_test_host-mysql-pma_test_user-' for key 'PRIMARY'' on query. Default database: ''. Query: 'INSERT INTO `mysql`.`tables_priv`(`host`, `Db`, `User`, `Table_name`) VALUES(\"pma_test_host\", \"mysql\", \"pma_test_user\", \"\")'\r\n\r\nLast_Error: Error 'Duplicate entry 'pma_test_host-mysql-pma_test_user--PROCEDURE' for key 'PRIMARY'' on query. Default database: ''. Query: 'INSERT INTO `mysql`.`procs_priv`(`host`, `Db`, `User`, `Routine_name`, `Routine_type`) VALUES(\"pma_test_host\", \"mysql\", \"pma_test_user\", \"\", \"PROCEDURE\")'\r\n\r\nThe \"mysql\" database is not replicated over the cluster. \r\nreplicate-ignore-db = mysql \r\nreplicate-ignore-db = information_schema\r\nreplicate-ignore-db = performance_schema\r\n\r\nI dont have configured the pma control user as I dont use the pma configuration storage.\r\n\r\nIt seems like pma is doing some permissions checks after I log in with my account which seems to break my master master replication."},"comment":{"url":"https://api.github.com/repos/phpmyadmin/phpmyadmin/issues/comments/165480284","html_url":"https://github.com/phpmyadmin/phpmyadmin/issues/11752#issuecomment-165480284","issue_url":"https://api.github.com/repos/phpmyadmin/phpmyadmin/issues/11752","id":165480284,"user":{"login":"devenbansod","id":5762808,"avatar_url":"https://avatars.githubusercontent.com/u/5762808?v=3","gravatar_id":"","url":"https://api.github.com/users/devenbansod","html_url":"https://github.com/devenbansod","followers_url":"https://api.github.com/users/devenbansod/followers","following_url":"https://api.github.com/users/devenbansod/following{/other_user}","gists_url":"https://api.github.com/users/devenbansod/gists{/gist_id}","starred_url":"https://api.github.com/users/devenbansod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devenbansod/subscriptions","organizations_url":"https://api.github.com/users/devenbansod/orgs","repos_url":"https://api.github.com/users/devenbansod/repos","events_url":"https://api.github.com/users/devenbansod/events{/privacy}","received_events_url":"https://api.github.com/users/devenbansod/received_events","type":"User","site_admin":false},"created_at":"2015-12-17T15:15:00Z","updated_at":"2015-12-17T15:15:00Z","body":"Can you login properly from 'hostname1' ?\r\n\r\nThis is caused because we want to test if the user has the required privileges to perform the automatic *'adjust privileges'* action while moving/copying a database, a table, a column or a procedure.\r\n\r\nWe do this by running a few test queries after a user logs in to check if the user can perform those queries and then cache the result for his/her entire session.\r\n\r\nNow, in your master-master setup, since `mysql` database is not replicated. It is causing an error since the replication tries to insert the same row twice.\r\n\r\nOne possible solution is to use `SET @@session.foriegn_key_checks = 0;` before testing the insert privilege and then `SET @@session.foriegn_key_checks = 1;` after the insert check. (we are deleting this test row as soon as we are sure we can insert into `mysql`.`db`).\r\n\r\nI will make a PR to fix this soon."}}