mass update change allowed remote ip for all databases for remote access

Discussion in 'General' started by tntteam, Apr 4, 2017.

  1. tntteam

    tntteam New Member

    Hi there,
    We are hosting a phpmyadmin instance on one web host, and plan to move it to another web host.
    But for PMA to work, we need to add the IP of the new hosting web server as remote_ip allowed to all existing databases.

    I tried to change web_database table remote_ips field but this doesn't sync with mysql. Running resync db from ispconfig web interface doesn't work either.

    I've seen ispconfig works by adding update request for this in the sys_datalog table like this :

    INSERT INTO `sys_datalog` (`datalog_id`, `server_id`, `dbtable`, `dbidx`, `action`, `tstamp`, `user`, `data`, `status`, `error`) VALUES

    (13256, 5, 'web_database', 'database_id:417', 'u', 1491306661, 'admin', 'a:2:{s:3:"old";a:21:{s:11:"database_id";s:3:"417";s:10:"sys_userid";s:1:"1";s:11:"sys_groupid";s:3:"507";s:13:"sys_perm_user";s:4:"riud";s:14:"sys_perm_group";s:4:"riud";s:14:"sys_perm_other";s:0:"";s:9:"server_id";s:1:"5";s:16:"parent_domain_id";s:3:"704";s:4:"type";s:5:"mysql";s:13:"database_name";s:13:"testguillaume";s:20:"database_name_prefix";s:0:"";s:14:"database_quota";N;s:23:"last_quota_notification";N;s:16:"database_user_id";s:3:"285";s:19:"database_ro_user_id";s:1:"0";s:16:"database_charset";s:0:"";s:13:"remote_access";s:1:"y";s:10:"remote_ips";s:15:"1.2.3.4";s:13:"backup_copies";s:1:"1";s:6:"active";s:1:"y";s:15:"backup_interval";s:4:"none";}s:3:"new";a:21:{s:11:"database_id";s:3:"417";s:10:"sys_userid";s:1:"1";s:11:"sys_groupid";s:3:"507";s:13:"sys_perm_user";s:4:"riud";s:14:"sys_perm_group";s:4:"riud";s:14:"sys_perm_other";s:0:"";s:9:"server_id";s:1:"5";s:16:"parent_domain_id";s:3:"704";s:4:"type";s:5:"mysql";s:13:"database_name";s:13:"testguillaume";s:20:"database_name_prefix";s:0:"";s:14:"database_quota";N;s:23:"last_quota_notification";N;s:16:"database_user_id";s:3:"285";s:19:"database_ro_user_id";s:1:"0";s:16:"database_charset";s:0:"";s:13:"remote_access";s:1:"y";s:10:"remote_ips";s:14:"1.2.3.4";s:13:"backup_copies";s:1:"1";s:6:"active";s:1:"y";s:15:"backup_interval";s:4:"none";}}', 'ok', NULL);​


    But it's way too complicated to generate such requests for every databases.

    How could I massively resync remote_ips from web_database table to mysql servers ?

    Thanks
     
  2. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    in phpmyadmin / mysql: update web_database set active = 'y', remote_ips = "your_ip1, your_ip2"
    tools -> resync
     

Share This Page