I want to install 2 magento2.4.4 on my server and connect with single database .
3 Answers
Is there a reason why you would not make use of the Magento multi-store functionality? Two applications passing data to the same database at once seems to be a bad idea, in my opinion.
Multi-store allows for multiple URLs, as well.
I also don't see the benefit of using the same database for 2 instances; it will just lead to performance issues, and complicate work for developers.
Also, I guess many extensions will have problems with this setup.
However, to answer the question:
At least one of the instances needs to have a db->table_prefix
set in app/etc/env.php
; you need to set this value before installation.
That's all.
It's Overlapping your both site, it's not possible to 2 site in 1 database, both data overlapping every update, so i'm not prefer to you. But you can do it with app/etc/env.php in give databse name for both site.