I’ve never tried this but I’m currently considering database design and wanted to know if its possible to run SQL Queries against two separate MySQL Databases on the same or different Server/Cluster?
Also what are speed issues with these types of configurations (cross database)?
Yes, why not, you can use same query for different MySql Database, all you need is their authentication to access that particular database. I mean to say, the
usernameandpasswordfor each database. Like inphpwe use these script to connect our database.So, you need to create different connection script and change them accordingly. As you see,in my connection script
hostnameis the server location (generally it is an IP address, where your server is), currently it is set tolocalhost(you can change it to 127.0.0.1), since my computer itself serve as a server. So, you need to change the server details only (if database, username and password are same for all).Now, coming to next part of your question i.e. speed issue, so i would say, it depends on the server, how much time it takes to respond. There are many factors (like number of user, server respond time and etc) that affects the speed issue.