No sql server database connection with localy used IIS - sql-server-2008

i am trying to get a database connection through my IIS with an MVC Webproject.
In my Web.conf connection string i use following parameters:
data source=[Computername]\[DatabaseInstanceName]
This doesn't work for me.But when change the [Computername] to my IP-Adress it works.
Somebody with an idea what i can do? Because it's annoying to change this everyday in several files.
edit: i am using the IIS 8

There are several ways I verify my connection
1) If you are using visual studio,
a) on the Data menu click on Transact-SQL Editor and check this dialog
b) Another trick is I try to create a datasource, follow the dialog box and copy the connection string that Visual Studio generate
c) If look at the Server Explorer and you can find your database there, right click the database and click Properties

The computername needs to be accessible to the machine. Currently only the IP address works because nothing is telling the system that myComputerName is the machine located at the IP address.
You can either add an entry to your hosts file or to a local DNS server if one is used. If adding to your hosts file (it'll be somewhere like C:\Windows\System32\drivers\etc) and you'll need run your text editor as an Administrator. The entry will look something like this:
192.168.1.1 JSCWorkstation
(obviously change the IP and computer name to your actual values. If the database is running on the same machine as the application you can use the local loopback address (127.0.0.1) as the IP for the entry.
If you are in an environment with a local DNS server you can ask an administrator to add a similar entry in the DNS server.
Once this is done your machine can be found by name rather than by IP address. You can test by opening up a command prompt and typing
ping myComputername. If you get a reply, all is well.

Related

Finding MySQL localhost URL and/or accessing phpmyadmin

Going around in circles. Please help, I enter http://localhost into safari on my mac and receive: It works!
However, I cannot figure out how using MySQL workbench I can find the URL. I am looking to code JSON in xCode to retrieve data from my local MySQL database, however, I do not even know the URL to access it.
My port is on 3306. I have tried http://127.0.0.1:3306 - and get a failed to open.
Do I need myphpadmin or can I go direct to MySQL?
I have tried saving a copy of MyPhPAdmin under Users>MyUserName> but this did not work when I ran: http://localhost/myphpadmin
Should the file be saved elsewhere? When I worked on Python weeks ago I run it under a different location then was recommended (Under the Python X.X cache folder) whereas online people simply ran it from their Users>MyUserName> folder. I am on the latest Catalina OS X.
Tried http://localhost/usr/local/mysql-8.0.20-macos10.15-x86_64/phpmyadmin/ - 404 not found
With MySQL, you can connect via localhost "socket" or networking "TCP/IP" connections. The user accounts in MySQL exist separately from each other, so if your user account exists with host value 'localhost' the TCP/IP connection probably won't work for you. Also note that, depending on how you installed MySQL and how it's configured, it might not even listen for network connections. Normally, localhost is preferred if you are on the same machine.
In MySQL Workbench, you need to give the hostname or IP address when selecting "Standard (TCP/IP)" from the "Connection Method" dropdown. This is simply the hostname or IP address, not a complete URL or web site. So you'd set the hostname to "127.0.0.1" or "192.168.9.34" or whatever. Again, Local Socket/Pipe is usually a better choice in most cases.
MySQL uses its own networking port (3306) and communication protocol, so using http://127.0.0.1 is incorrect as it isn't using the http protocol. Likewise, if you would need to change the port for some reason, specify that in the port field rather than as a part of the hostname.
As for phpMyAdmin, you would install that to a folder that is handled by your web server, then access it through the URL/path exposed by the web server — by default, your user home directory is not shared to the web (and rightly so, I don't want all of my documents and files shared with the world!). Put the phpMyAdmin folder in your web root and you'll have better success. Which folder that is probably depends a lot on which webserver you are running, how it is installed, and how you configured it.
I won't comment on the Python scripts you've run in the past, as my experience with serving Python to the web requires adjusting some settings in my nginx configuration and I won't want to confuse you compared to the tutorials you're following.

Can't access SSRS Report Server using Host Name

I have a local installation of SSRS Report Server (2017). If I try and access the reports portal using http://HostName/Reports I get a "This page can't be displayed" error. If however I use http://localhost/Reports the portal loads. I have a separate issue and by solving the issue described I'm hoping that this other issue will resolve itself.
Open a Command Prompt - Start Menu -> cmd and type:
hostname
to check if you have the hostname correct. If you do, open the
C:\Windows\System32\Drivers\etc\hosts
file in notepad and check if there are any lines relating to your hostname or local ip.
If not, then go back to command prompt and do
nslookup
then type your hostname
[HostnameFromAboveStep]
and see which IP Address is reported, then type
ipconfig
and see which IP you actually have

Can Putty Connect To Remote DB and Open PhpMyAdmin?

mostly likely a dumb question as I know PhpMyAdmin is a browser-based application and typically putty connects to MySql via command line.
I typically manage my dbs direcrtly via PhpMyAdmin and am wondering if through Putty I can open PhpMyAdmin or perhaps create a tunnel that will allow me to access through a physical UI.
Might be a shot in the dark here but if someone could help spoon feed me an answer on this I would very much appreciate the guidance. Not finding many useful resources online.
In PuTTY you can add tunnels to an open SSH connection by clicking the icon in the upper left of the PuTTY terminal sesssion and selecting change settings. In the Category tree select Connection->SSH->Tunnels. Add a new Tunnel by filling in an unused local port number such as 8880 and a destination of localhost:8080 and click add. If necessary change the destination port to the one your PhpMyAdmin listens on.
Now you should be able navigate to the PhpMyAdmin on the remote machine by navigating to your local machines port 8880 by entering localhost:8880 (or whatever local port number you used) into your browser.

Connect Google Data Studio to Local Mysql Server

I have started using Google's Data Studio I found it very easy to turn the Excel data into Intuitive Business Dashboards with little or no coding skills.
But I have a problem here, whenever I try to connect to Mysql DB (running on my local system) I'm facing error.
Connection Details:
Error Message:
I tried googling the Error Code but No luck.
But I'm able to access the local Mysql Server from Mysql Workbench.
What is that I am missing here? Data Studio Heros?
Thanks in advance.
Simple answer: To expose a localhost service to the web, you have to use ngrok.
For your MySQL the command is:
ngrok tcp 3306
Then the hostname you have to use data studio will be displayed.
Google Data Studio operates on the Web, thus does not have access to your personal local network. However,
You may make you MySQL db Engine accessible to the web by changing the bind-address parameter (See on MySQL Workbench, Instance > Option File > Networking > General > bind-address) to 0.0.0.0.
You also need to create a new user allowed to connect from Hosts Matching %, since Google Data Studio servers are using a dozen of different IP addresses (https://support.google.com/datastudio/answer/7088031?hl=en)
Please refer to this question:
How to make mySQL database at my local accessible from different machines?
Please note that this is a bad practice to open an access to your personal computer and you may instead want to use a MySQL or MariaDB cloud service such as https://console.cloud.google.com/launcher/details/bitnami-launchpad/mariadb
You cannot put host address as localhost.
1) You will need to check your device address at whatismyip.com or something like that.
2) Second thing you need to check is if your device is under firewall or not.
You can refer below URL for more information
http://qsok.com/x/KIBr
As Will mentioned above, it's best practise to use cloud service such as Google Cloud itself to host your MySql database and then take the connection there.
When you connect your database to Data Studio you need to open firewall for all the IP addresses it uses. You can find the whole list of IPs on the bottom of this support article https://support.google.com/datastudio/answer/7088031?hl=en
If your database is behind a firewall, you will need to open access to
the all of the following IP addresses. These are used by Data Studio
to connect to and query your MySql database.

Login to EC2 server to create MySQL database

I had a friend create an AWS account and an EC2 instance after which he gave me the username and password to login. I am having a lot of trouble getting into the server with the information he gave me. I'm new to amazon services so I'm not sure if I'm doing something wrong or not. I seem to be able to login using PuTTy, but it doesn't prompt me for a password, I just get through with the username alone. copying the ip into a browser just gets me a "This webpage is not available"
message. He also gave me the key file but I'm sure where to use it.
Anyone know how I can get into the server to modify the database?
If there is a message 'This webpage is not available' then it could be there is no HTTP server running on port 80, or the security group configured on the EC2 instance is set to deny connections to port 80. If it is a new instance, there probably isn't a firewall configured locally to deny connections.
If you are sure there is a server running on port 80, you can use these instructions to tunnel through SSH
Set up your PuTTY window like this, and hit the Add button
Navigate to http://127.0.0.1 and you should see the web server if there is one running, if you can navigate using this way, you have a problem with your security group configuration. If you cannot, you do not have a HTTP server running to connect to. If there is not one running (and I am assuming you wish to use phpMyAdmin), you may have to set up apache and install phpMyAdmin
As you connect without a password, do you receive a line along the lines of
'Authenticating with public key "unipc-rpi"' or mentioning 'Pageant', because it means that instead of a password, PuTTY is authenticating using a public key and not a password.