Best way to allow access to MySQL database for roaming users - mysql

Currently I have a Windows Application that I made that several companies use. Each one has their own privileges based upon a name and their public IP address to their own database.
I have a few users that travel and will not know their IP addresses in advance.
Can anyone offer some advice as to the best way to allow them access to their database, without me having to open up their database access to all IP addresses? Or is there really no way around this?
Keep in mind I am a newb when it comes to mysql stuff. But I am willing to learn!
Any thoughts are appreciated.

In my opinion the best way is to use a road-warrior VPN configuration and have static IP addresses assigned to each 'warrior' which you can use in Mysql as the host field. Check out OpenVPN for example.
Example: http://zeldor.biz/2011/05/openvpn-road-warrior-setup/

I ended up opening it to all IP addresses and using very strong names and passwords.

Related

Please do not block this query about mysql

I have a list of mysql databases with Godaddy. I did not give them clear names now I cannot find out which website they pertain to. Can someone tell me where I can see the name of the website or domain the mysql is connected to. My fault, dumb thing to do.
Please do not get me blocked for asking a simple question.
Cheers
The great thing about domains hosted on GoDaddy is that you can access any of your mysql databases through any of your domains if they are all under the same account. MySql isnt connected to any particular domain name, but rather the mysql exists on the same server and is accessible by any of your domains. Please comment if you need further clarification, or edit your question.

Application authorize and authenticate user with database

I am writing a multi-user-application in Delphi (Object Pascal).
I want to use either MySql, Oracle or PostgreSQL as database.
I have a table Users with a username and password column.
(I do not want to have seperate DB logins for each user)
Of course the application itself has to connect to the database and authorize users by the entered username and password combination.
Software like SAP, Sage or Social Networks would use the same approach, i would guess?
So the application has to know a DB login username and password to connect to the database and then check the Users table.
My question is:
Where do i save the DB login username and password for the application so it can check the Users table?
I do not want to hardcode it in the application as it can be easily accessed by reverse engineering and then used to directly connect to the database.
Honestly, your best approach is to follow best security practices around your server. You could use a salt, but the hash function will have to live on the server, too, and if a hacker has access to the server in the first place then it won't be long before they find the hash and pull the password.
I think efficient organization actually produces some security through obscurity. That is, put the DB connect credentials and string in a config file. Still, access to the application code will give a hacker the clues to get what they want, but it doesn't mean you shouldn't follow best coding practices.
Then, lock down your box. Work with your security team to make sure it isn't accessible by anyone they don't want accessing it.

I have a mysql database on my laptop. How could I connect to it when I am not using the Local computer?

It may seem like a silly question but i've never given it any thought. For the past few months i've been building a database and only ever accessed it through my laptop ( which is what I think is called the local Host, but please correct me if I am wrong). Yesterday, intuitively I thought, what if I were away from my laptop but would really like to either access the data or amend some records, how would I be able to do it. Which is the reason for my question.
I know when I use it locally all I do is enter the database, username and password via python for example. So, what if I was at an internet cafe and wanted to pop in and access my database. How would I do this?
You have to mention your ip address of your system with defined port in that way you can access your database anywhere
How do I connect to this localhost from another computer on the same network?
Question was already asked. Go to the answer, very helpful information.

Connect to database on different server

Here's my situation: I have a file, homepage.php, that I want to allow my customers to host on their servers. homepage.php needs to somehow get information from my database, but I don't want my customers to have full access to my database. What's the best way to do this and how can I make it work?
I tried to do it by including the line:
require( "http://www.mydomain.com/connect.php" );
in homepage.php but I'm not sure if that's the right way and also, it gives me an error.
What error does it give you? Also that won't work because your server parses the PHP and send back the result, rather than including the source code like you want.
Easy solution
Have a read-only account, and give those details out to your customer's pages.
Then they can set up the mysql connection with the IP/exposed port of your mysql server and log-in from there.
Better solution
Have accounts for each customer, so privileges can vary accordingly, otherwise same as above.
Best solution
Expose access via a SOAP service. If you have enough customers and they're developing with you, an API is invaluable.
Without the warning it is hard to troubleshoot the connection issue although I bet it might have something to do with it looking at localhost versus the IP of the machine where the database resides.
The best solution is to have an ini file that has the username and password in it for each individual customer and have the connect.php file look for the ini file on that customers local webserver. You can then configure the priveleges for each account to have only select access to certain tables, or update priveleges to certain users, etc.
Also if your customers will be building their own code around yours, developing a SOAP service might be useful.

want to connect multiple users with MySql server?

can i connect multiple users with a user name and password on a single port with Mysql server
if not then what is the best approach to do this
help required
regards.
it should work fine. It is the normal usecase of a SQL Server.
It all depends on how your Server is set up. If you chose to let two people share the same creedentials consequently they will be able to both access certain data.