Good day, I want to try to connect to my database in my NAS.
Please take a look the image below.
![nas](https://learn-attachment.microsoft.com/api/attachments/dc36f09b-a602-4aec-a9c9-2fc244e9316f?platform=QnA)
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.
![User's image](https://learn-attachment.microsoft.com/api/attachments/7f5db18d-c1b5-4dea-8af1-6fa2f89029f7?platform=QnA)
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.