MySQL Forums
Forum List  »  Newbie

Re: Connecting to my mysql server
Posted by: Barry Galbraith
Date: July 23, 2017 11:39PM

>"Bob" activates the page which runs the script containing the connection to the database "localhost." Would this even work?

Yes, of course.
Your php script runs on the webserver, where MySQL is localhost. Your application (a php script) is the database user. Bob from Oregon is a web application user, and it's up to your application to validate (or not!) which users are allowed to access your web application.

>2) If I want someone else to access my mysql.
You mean someone else's web application?
It's a security risk to let anyone access your database, but if you really want to, you would create another web user (e.g. bob@oregon.com) for bob's script to use, and grant that user whatever priveleges he needs. The hostname would be whatever domain name your server is running. You would need to enable tcp/ip for your MySQL (it's probably using a socket now for security), open port 3306 in your firewall for traffic from Bob's domain oregon.com.
All that said, it's still a security risk.

Good luck,
Barry.

Options: ReplyQuote


Subject
Written By
Posted
Re: Connecting to my mysql server
July 23, 2017 11:39PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.