When does a database get created?
Is it created automatically when running “bench new-site <site_name>” command?
I have created three sites but only one database is found in bench mysql.
When we create a DocType , does it automatically create a table?
I am following the developers guide (library management) in the github. Please do provide with the links of some good examples or tutorials.
Regards
Hi @ninjas005 ,
When you use bench mysql it will open the mysql console for the current site.
If you want to access the other site’s database then you will need to change the current site using
bench use sitename
then run the bench mysql
And yes, database table is automatically created after creating the DocType.
Thanks
4 Likes
Hi,
you can use following link also
http://frappe.github.io/frappe/user/tutorial/
Shraddha Ranjane
New Indictrans Technologies Pvt. Ltd
1 Like
Hi makarand,
when i run these commands
i get following errors…
Traceback (most recent call last):
File “/usr/lib64/python2.7/runpy.py”, line 162, in _run_module_as_main
“main ”, fname, loader, pkg_name)
File “/usr/lib64/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/erpnext/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/home/erpnext/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/home/erpnext/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/erpnext/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/erpnext/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/erpnext/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/erpnext/frappe-bench/env/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/commands.py”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/commands.py”, line 741, in mysql
os.execv(msq, [msq, ‘-u’, frappe.conf.db_name, ‘-p’+frappe.conf.db_password, frappe.conf.db_name, ‘-h’, frappe.conf.db_host or “localhost”, “-A”])
TypeError: coercing to Unicode: need string or buffer, NoneType found
Hi @ninjas005 ,
Please provide the valid site name. check your sites directory for site name.
Thanks
1 Like
Thanks @makarand_b
i misspelled site name.
One more doubt , how can i see the newly created site in the browser ?
every time i go to localhost:8000 and login as Administrator , i see the old site.When i use new password it shows invalid login.
Does each site runs with separate port numbers?
Hi,
yes, each site should runs with different port number.
Steps:-
Go to respective folder where you setup
2.bench use sitename1
3.bench serve --port 8000
If you want to run another site at the same time, run bench --site {sitename} serve --port 8005 in another terminal.