I setup a site on my localhost and I am getting unable to connect to database errors. (its not my local database) and now I am trying to connect to that database in the command line to see if its a firewall issue or php issue.
Whats the command to test a database connection (not local) in cmd?
Here is a quick way you can test for database connectivity with no other database software installed :

It depends on what kind of database are you trying to connect to.
e.g. if you're connecting to Oracle db you may use something like this:
sqlplus <user>/<password>@<service>
if it's a Microsoft SQL Server you may use
osql -U<user> -P<password> -S<instance>
If you just want to test network ports to be sure no firewall is preventing connection, you can use telnet tool,
telnet <server-address> <service-port>
(default tcp port for Oracle db service is 1521, for SQL Server's 1433)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With