Use different socket file to connect with one dataBase

Hi,
I am working with linux containers in order to simulate adhoc networks.
Under my host i create several containers, each one represents a fedora host…but they are in reality using one common root file system.
I installed mysql server in this root file system as a result every container will have mysql server. Firstly,i had a problem that one container only can connect to mysql server at one time. Trying to connect to the mysql database from another one will cut the connection in the previous container. Any way, i fixed this problem by specifying a different socket file for each container. With my solution any container can connect to my DataBase and execute select query without any problem. I noticed that inserting a row to any table from one container is ok and i can get it, by a select statement, from this container. But i cannot get it from other containers. I need to restart mysql server at these other containers to get the updated data. Another things, deleting or updating rows in the database from a container will cause table crash.
I think that connecting from different containers to one database is considered as connecting several servers to one database and this could cause
problem according to mysql documentation.

Sorry for the long explication :blush:, any idea to solve this problem?
Thanks,
MALATTAR

Don’t use sockets but send your query over TCP/IP.
The virtual hosts don’t need their own servers - or do they?

I aim to make my adhoc network simulation as near as possible to a real one.
So, every node must has its own services including mysql server…

Then you will have to include a separate MySQL server into each of your containers, with different absolute socket file paths.

I think the problem will not be solved, because i need these several mysql servers to deal with one Database…
I think it is better to create a different DB for each container. So a complete separation between the containers

Either you are trying to simulate separate machines with separate DB servers. Then you need different physical sockets for each one.
Or you are trying to simulate separate machines with one central database. Then you could use TCP/IP instead of sockets.
Or you are trying to simulate separate machines with a replicated database on each server. In this case you would have to install replication on each of the virtual servers.