I can access a non-WP database (which is on the same server as the WP database) from within WP, MyPHPAdmin can access both the WP and non-WP database and my application can access the non-WP database, but I can’t access the WP database from the app. I get a MySQL error “Access denied to user”.
Can anyone tell me if this is by design? Is WP deliberately preventing me from interfering with tables in it’s database or am I just missing something somewhere? Any suggestions would be gratefully received!
]]>I have one question, Do you need to access your non-wp tables in your WordPress source or an external source?
If its in wp you can access with global $wpdb variable
]]>Rajan,
I can already access the non-WP tables, it’s the WP tables I can’t access from the external program.
The way to find out is to run another query that’s about as generic as possible. Soemthing like:
SELECT * FROM wp_posts
Or even any of your own custom tables in that database. If you get an error, it would be permissions problems for that user. If you get a result, you’ll have a problem with the SQL statement in your initial query.
]]>Dumb beginner’s mistake: I had set the Access Host for the external database in DirectAdmin to my PC but had forgotten to do that for the WP database. Once I added that I had access to the WP database.
Sorry for having wasted anyone’s time. At least it might help the next newbie!
]]>