Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6773877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:43:13+00:00 2026-05-26T15:43:13+00:00

First off, if there is an exact duplicate – I didn’t find any so

  • 0

First off, if there is an exact duplicate – I didn’t find any so I apologize in case the answer was already provided.

I’ll present the problem I’m facing, hoping I’ll get some insight or a straightforward “not possible” answer.

How to secure database credentials in a web application in case the server where PHP is gets compromised?
Assume that in this problem’s case we are not talking about shared hosting, VPS or anything alike, there’s only one person who has access to the box that stores MySQL information.

MySQL server itself is located at another (remote) box and allows connections from only a range of IP addresses (bound to the PHP box).

How to ensure that malicious user will not be able to obtain the details needed for connection string for MySQL? Assume that the user has broken the root login of the linux box running PHP.

What steps would you take towards providing highest security in terms of accessing information needed to establish MySQL connection in such a case?

Thank you for reading and commenting in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:43:14+00:00Added an answer on May 26, 2026 at 3:43 pm

    The best solution here, if this is a main priority, would be to use stored procedures.

    Stored procedures store the database queries inside the database, therefore just set them up, and then create a new MYSQL user with just stored procedure execution permissions. That way even if the application code was compromised they would only be able to manipulate a limited subset of your data, and they also gain no knowledge of the underlying database structure.

    The negatives to this approach are maintainability, due to the fact your mixing application logic with your storage system, and it might not be portable across platforms.

    If you want a simple solution, what hafichuk suggested might be better, just customize it to fit your needs. Unfortunately your script needs to be able to access the database, unless your web server and application server were on separate machines and communicated over some encrypted channel such as SSH, but then your just getting too complicated. It all depends how important protection really is to you, and how far your willing to go to ensure it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First, I know there are methods off of the generic List<> class already in
First off, I want to apologize beforehand, as I know there is a lot
First off, is there any way to access one of the path lines you
First off, I'd like to apologize for the horrid title there, but it was
First off I apologize if there is another post out there that answers this,
First off, there's a bit of background to this issue available on my blog:
First off, I'm using the Qt 4 libraries and C++. Is there a way
First off, I know there are ways to make it so that text can
First off, I realize that there is no such thing as a perfectly secure
First off, this question is not what does the constructor property do? - There's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.