Set-MariaDB-Host

Got his error when trying to set mariadb host

bench set-mariadb-host "192.168.0.3" bench set-mariadb-host 192.168.0.3
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==0.1', 'console_scripts', 'bench')()
  File "/home/vef/bench-repo/bench/cli.py", line 56, in cli
    bench()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 664, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 644, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 991, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 837, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 464, in invoke
    return callback(*args, **kwargs)
  File "/home/vef/bench-repo/bench/cli.py", line 352, in _set_mariadb_host
    set_mariadb_host(host)
  File "/home/vef/bench-repo/bench/utils.py", line 351, in set_mariadb_host
    update_common_site_config({'db_host': host}, bench=bench)
  File "/home/vef/bench-repo/bench/utils.py", line 354, in update_common_site_config
    update_json_file(os.path.join(bench, 'sites', 'common_site_config.json'), ddict)
  File "/home/vef/bench-repo/bench/utils.py", line 357, in update_json_file
    with open(filename, 'r') as f:
IOError: [Errno 2] No such file or directory: './sites/common_site_config.json'

I’m using VM but mariadb server is on my windows local. How to set mariadb-host properly?

Did you delete your common_site_config.json?

No, I didn’t. Never touch and even know about this file. I always use
production, not development.

Where to get this file? Just updated to latest v5.4.2

just check if that file is present first and get back here, !!!

No, cannot file the file under that directory. How could the file is not
exist?

Okay, i presume you wanted to say “you cannot find the file under the directory”, if that’s the case send i will post a link to the copy of the file and you try and see if that works for you!

@djff where’s the link? Tks

Just and a file with that name and with empty braces {} as the content.

sorry, was not online since, as rmehta said, you could just do that as for me, i just commented the the line and it worked for me!! or you create and empty file with that name!

Thanks, will try this…

I’m using VM and run bench set-mariadb-host 192.168.10.210 (Fresh MariaDB was installed in Windows host)

bench --force restore ~/sqlpath and it gave this error:

_mysql_exceptions.OperationalError: (1130, "Host '192.168.10.210' is not allowed to connect to this MariaDB server")

Any hints? Tks