Hi everyone,
I am using a server on which I don’t have access to the Root Mariadb user.
I have a another user called ‘frappe’ that has enough rights to create a new DB and I wish to create a new site with the bench CLI.
Therefore I am using: bench new-site site10 --mariadb-root-username frappe --mariadb-root-password frappe --verbose
But I am getting the following error:
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
main()
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
click.Group(commands=commands)(prog_name='bench')
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 27, in new_site
verbose=verbose, install_apps=install_app, source_sql=source_sql, force=force)
File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 58, in _new_site
admin_password=admin_password, verbose=verbose, source_sql=source_sql,force=force, reinstall=reinstall)
File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 35, in install_db
create_database_and_user(force, verbose)
File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 59, in create_database_and_user
if force or (db_name not in dbman.get_database_list()):
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/db_schema.py", line 543, in get_database_list
return [d[0] for d in self.db.sql("SHOW DATABASES")]
File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 107, in sql
self.connect()
File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 64, in connect
self.use(self.user)
File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 69, in use
self._conn.select_db(db_name)
_mysql_exceptions.OperationalError: (1049, "Unknown database 'frappe'")
It seems that Frappe is confusing the DB Name and the user name (extract from frappe/database.py):
The issue may come from earlier but I haven’t been able to understand it correctly yet.
I think I may be misundertanding the purpose of these command options, but if anyone has any idea I would be grateful!
Thank you!