1

I have, let's say, a root website with mysql db on a remote server.

I want to connect to that particular database (to make queries), from many other little websites (with lower priviledges).

Can this be done?

Language: jsp, java, php

5 Answers 5

2

Any particular problem? Just specify server address instead of 'localhost' in connection string.
You can also create dedicated user with minimal privileges for that.

Sign up to request clarification or add additional context in comments.

Comments

2

The default configuration often contains a variable

 skip-networking

which you need to comment-out in order to have networking enabled.

Comments

2

Yes it can be done, MySQL allows connections from remote hosts (assuming MySQL is configured to allow network connections and assuming the remote hosts are granted). In case of problem, the section 5.4.7. Causes of Access-Denied Errors lists most common problems and solutions.

Comments

0

In addition to the answers from Nikita Rybak andPascal Thivent, I'd like to note that most hosting providers don't allow queries from locations other than localhost.

I don't know how much access you have to the server configuration, but I would have saved myself a headache a while back when I first started experimenting with connections across domains/servers.

Comments

0

If the MySQL server is under your control, it's not difficult; you can find the procedure here. If it's not, the only thing you can do is beg the admin to do it, otherwise it's impossible.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.