Some DBs, such as ms sql server, provide a guid data type, I'm not sure about mysql.
In general, the problem is not related to char or varchar as the primary key, if they are not too long. Usually integers are preferable because they are slightly faster, but it depends on how important this is to you.
Effectively, you can also use a composite primary key. One component may be your initial primary key, which is unique in only one db. The second component can be a database number if you can assign a unique number to each database.
You can also use the following scheme:
int newId = dbNumber * 10000 + iDInSmallDb;
So the last 4 digits are the original db, the other digits are the db number.
source share