Connect to phpmyadmin web server xampp in c#

A string is needed for the parameters to connect to the phpmyadmin

 MyConnectionString = "Server=localhost;Database=database;Uid=root;Pwd=";

I have setup a web server using xampp, it has also its own domain using no-ip.biz and can be accessed online. I have a c# program that changes the values in the myphpadmin of the web server. I can access and the change the values if the program is in localhost and running on the server machine. My question is what will i place in the "Server=" so that the program can make changes to the web server database thru the internet? I have searched multiple questions but all uses localhost. I have also tried to place the domain and the ip address of the web server in the "Server=" but it still cant connect.

Do i need to place something in the "Server=" and/or do i need to change some settings on xampp/phpmyadmin on the web server?

Upvotes: 0

Views: 2136

Answers (1)

LeoR
LeoR

Reputation: 369

What you want to do is access your MySQL server remotely. PHPMyAdmin is just a front end for that, not the database itself.

MySQL allows remote connection, but depending on the server configuration it may or may not be enabled. It's hard to say without knowing your setup, but if you have control of the server then following a guide such as this one may work. This SO question addresses doing it on Windows.

REMEMBER that enabling remote access is always potentially risky. Make sure you have a strong password set for all databases before allowing remote access. I'm not too familiar with MySQL's remote access setup, but it may be that you can restrict access to particular databases and users. If you can, do it. Consider also only allowing access from the IP addresses you're running your application on. You may also need to forward the port that MySQL uses through your firewall. It's generally 3306, but you can change it in the configuration.

Once you've enabled remote access then it should be as simple as putting the server address instead of localhost (ie example.no-ip.com).

Upvotes: 1

Related Questions