Good day, I want to try to connect to my database in my NAS.
Please take a look the image below.
As you can see at the image, I want to access my database outside in my home network.
I already installed phpmyadmin in my NAS, but the problem is I don't know how to access it.
I watch a lot of tutorial videos, but no one can fix my problem.
I try it in my own and this my error.
and here my codes
//for nas db
string mysqlcon = "SERVER=192.X.X.X;" +
"PORT=3306;" +
"DATABASE=TestDB;" +
"UID=root;" +
"PASSWORD=root;";
MySqlConnection mysqlconnection = new MySqlConnection(mysqlcon);
try
{
mysqlconnection.Open();
label2.ForeColor = System.Drawing.Color.Green;
label2.Text = "Connected";
}
catch (Exception ex)
{
label2.ForeColor = System.Drawing.Color.Red;
label2.Text = ex.Message;
}
finally
{
mysqlconnection.Close();
}
the server address is my NAS ip address.