- Can 2 servers in SharePoint farm have their own SQL server database? Or they must share database? because when I was installing second server in farm it said that servers must share config database.
- Can there be 2 central administration for 2 servers in farm? Or a farm can only have 1 central admin?
- What is the difference between SharePoint configuration database and content database?
Generally you only have one instance of SQL server per farm. Unless you cluster or mirror you instance.
A SharePoint farm can only have one central administration database although you can host the central administration website on more than one server in your farm
The SharePoint config database is used by central administration to help manage all of your web applications, site collections, service applications, what's server and services are on the farm etc. The content databases are used to store the content from any web application you create such as site, documents,etc. You can have content databases for individual site collections but the principle is the same.
because when I was installing second server in farm it said that servers must share config database.
Way before starting installation or implementation of SharePoint one needs to decide the topology they will follow as advised by Microsoft as best practices. I am actually very surprised by your questions specially when you are installing second server.
Anyway first thing you need to know is what a SharePoint Farm actually looks like,
Here's its definition is simplest words I could find
A SharePoint farm is a logical grouping of SharePoint servers that share common resources. A farm will typically operate stand-alone, but it can also subscribe to functionality from another farm, or provide functionality to another farm. Each farm has its own central configuration database, which is managed through either a PowerShell interface, or a Central Administration website (which relies partially on PowerShell's infrastructure). Each server in the farm is able to directly interface with the central configuration database. Servers use this to configure services (e.g. IIS, windows features, database connections) to match the requirements of the farm, and to report server health issues, resource allocation issues, etc.
Back to your first question, each SharePoint farm must have one Farm Configuration database, so when you were installing or adding another server(which I assume was a WFE) you are either allowed to create a new server farm or simply join farm which is already there (Joing farm means you will use farm configuration database which is already there. Its common sense 1 farm = 1 farm configuration database).
One SharePoint farm will have just one Central Administration but you can access or host it on different servers if required, Normally it is installed on WFE server only.
This diagram is the best way to tell you the difference between different SharePoint databases,
Check this diagram by Microsoft out for more details.
I think you are really really confused with concept of Typologies in SharePoint and would recommend you spending some time on reading about it.
One thing I forgot to mention that a SharePoint farm can have multiple SQL Servers, Here's an MSDN article on how to add another Database server to farm.