Accessing a non-WP MySQL database from inside WP?

I want to be able to query a non-WordPress MySQL database from within WP. Is this a safe practice, or will it break WP? Is there a good "best-practice" way to do this to make sure the databases don't get confused?