I need to create a query which connects to different databases with different users. Every database has its own user.
Can I achieve this with PHPMyAdmin?
I need to create a query which connects to different databases with different users. Every database has its own user.
Can I achieve this with PHPMyAdmin?
2
Answers
If you need different users to connect, then this is not possible at all within MySQL because a query runs in the name of a single user.
You need to have a single user that can access all databases and all the databases must be within the same MySQL server. Then you can write queries affecting tables from multiple databases, just refer to the tables using
database_name.table_name
convention.if what you need is accessing two db in a single query, I’m not really sure if it is possible.
However, you can still have a workaround for that,
Create two connections for querying data, then do data processing in PHP.