Erpnext Databases

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.


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.



you can use following link also

Shraddha Ranjane
New Indictrans Technologies Pvt. Ltd

1 Like

Hi makarand,

when i run these commands

i get following errors…

Hi @ninjas005,

Please provide the valid site name. check your sites directory for site name.


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?

yes, each site should runs with different port number.


  1. 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.