I have tried to connect to a DB2 DB using the command line:
schemacrawler --server=db2 --host=*myhost* --port=*myport* --database=*db2database* --user=*myuser* --password=*mypassword* --info-level=minimum --command=list --log-level=CONFIG
I get the following error:
SchemaCrawler 16.11.7
Error: Could not connect to
jdbc:db2://pathtodb:retrieveMessagesFromServerOnGetMessage=true;, for
user 'user', with properties {}: [jcc][t4][2043][11550][4.28.11]
Exception java.net.ConnectException: Error opening socket to server
myserver on port myport with message: Connection timed out: connect. ERRORCODE=-4499, SQLSTATE=08001
I have the suspicion that there is a problem in the company's firewall that does not let me connect from SchemaCrawler. I can connect to the db with DBeaver from a virtual machine (Saas). Since DBeaver is running SaaS I do not have access to the VM and cannot test from there.
How could I check if the network is blocking SchemaCrawler requests from my local machine (Windows 10 Enterprise 1909)?
Windows-10 includes ping and tracert and nslookup tools (you run these in a CMD window). These ping and tracert may help you determine if there is IP-level connectivity between your Win10 box and the target Db2-server. Refer to any good textbook to learn how to use these tools.
Windows-10 also has its own software-firewall ( run from the start box if you search firewall) which needs you to add a rule to open the relevant port for tcp and udp traffic. Your login may need to have suitable permissions to make changes like this, so in some corporate environments access is restricted. If this is the case, open a ticket with relevant support teams, as that is not a matter for StackOverflow.
If adding such a rule does not fix your symptom, then you should contact the network support people in your company to open the relevant ports or provide another means for you to achieve the goal.
Note also that there are other tools (arguably better tools) to get a DDL report for a Db2 database, including the db2look utility which is present in the Db2 fat client, and also present on Db2-LUW servers. If the Db2-server runs on either i-series or Z/OS then other tools exist for those environments so talk with the relevant administrators.
Related
The Goal
I need to get data from a MongoDB updated every 15 minutes to use to build into a PowerBI report.
The Gear
I am connected from my windows machine via ssh to an RHEL server (server a). This server is running powerbi connector (SQLD) which is connected to my MongoDB that is running on a different server (server b). I'm also running MySQL on server b. My powerBI connector is installed on server b.
Exactly where I'm at
I am using the steps listed here (and all the associated pages) and have tried everything listed short of writing a config file, as the fact that things are working on mongosqld's end makes me think I don't need it... and if I can't get it working manually, having a config file won't exactly help.
https://docs.mongodb.com/bi-connector/current/connect/powerbi/
Using:
mongosqld --mongo-uri="mongodb://10.xxx.xxx.xx" --auth --mongo-username="ThisGuy" --mongo-password="test"
I successfully map the schema and show an active connection in the command window. I can also access my database from compass using an authorization enabled URL.
When I set up an ODBC connector I use the IP of server a, the user and password from my url, and port 3307. Nothing shows up in the dropdown, when I click 'test' I get the following message:
Connection Failed
[MongoDB][ODBC 1.4(w) Driver]Can't connect to MySQL server4 on '10.xxx.xxx.xxx' (10060)
I have also tried 3306, 27017, and 27015. Just to be safe I also added firewall rules for all traffic on these ports. I've tried this many times, including (just for the hell of it, and I'm kind of new to this stuff) the ip of server b, the ip of my machine, the credentials for MySQL, basically any combination of these things that I can think of.
In powerBI, my odbc driver shows up, and when selected in the dropdown, it asks for a username and password. I have tried both mongo credentials and MySQL. Not sure which I should be using?
regardless, I get the following error inside PowerBI:
Details: "ODBC: ERROR [HY000] [MySQL][ODBC 1.4(w) Driver]Can't connect to MySQL server on '10.xxx.xxx.xxx' (10061)
ERROR [HY000] [MySQL][ODBC 1.4(w) Driver]Can't connect to MySQL server on '10.xxx.xxx.xxx' (10061)"
Thoughts
I don't control either server, although I have root access, being new to this tech and company I am wary of screwing anything up that a co-worker will have to fix. I read in a different SO thread that maybe I need to downgrade the version of MySQL that is running on the server and that it could fix the problem, but I don't think that it will actually help and am afraid I might screw up something else on the server if I do this:
The C Authentication plugin was developed against MySQL 5.7.18 Community Edition (64-bit), and tested with MySQL 5.7.18 Community Edition and the latest version of MongoDB Connector for BI. The plugin is not compatible with MySQL Server or Connector/ODBC driver version 8 and later.
https://dba.stackexchange.com/questions/219550/access-denied-when-connecting-to-mongosqld-with-mysql
Maybe the problem is that server B is listening to server a on port 3307, and that there is another unknown port (not mentioned above) that my ODBC driver must be listening to? I'm not sure how to test for this when you get a step away like this.
So that's it. I'm really stuck and would love some help, I am going to try the downgrade tomorrow if nothing else shakes loose and will keep this thread updated.
Thank you for reading
I'm setting up a server, with postgresql running as a service. I can use nmap to get current postgresql version
nmap -p 5432 -sV [IP]
It returns:
PORT STATE SERVICE VERSION
5432/tcp open postgresql PostgreSQL DB 9.3.1
Is there a way to hide the postgresql version from nmap scanning? I've searched but it's all about hiding the OS detection.
Thank you.
There's only one answer here: Firewall it.
If you have your Postgres port open, you will be probed. If you can be probed, your service can be disrupted. Most databases are not intended to be open like this to public, they're not hardened against denial-of-service attacks.
Maintain a very narrow white-list of IPs that are allowed to connect to it, and whenever possible use a VPN or an SSH tunnel to connect to Postgres instead of doing it directly. This has the additional advantage of encrypting all your traffic that would otherwise be plain-text.
You have a few options, but first understand how Nmap does it: PostgreSQL database server responds to a malformed handshake with an error message containing the line number in the source code where the error occurred. Nmap has a list of possible PostgreSQL versions and the line number where the error happens in that particular version. The source file in question changes frequently enough that Nmap can usually tell the exact version in use, or at least a range of 2 or 3 version numbers.
So what options do you have?
Do nothing. Why does it matter if someone can tell what version of PostgreSQL you are running? Keep it up to date and implement proper security controls elsewhere and you have nothing to worry about.
Restrict access. Use a firewall to limit access to the database system to only trusted hosts. Configure PostgreSQL to listen only on localhost if network communication is not required. Isolate the system so that unauthorized users can't even talk to it.
Patch the source and rebuild. Change PostgreSQL so that it does not return the source line where the error happened. Or just add a few hundred blank lines to the top of postmaster.c so Nmap's standard fingerprints can't match. But realize you'll have to do this every time there's a new version or security patch.
I'm desperate since my Google Cloud SQL instance went down. I could connect to it yesterday without problem but since this morning i'm unable to connect to it in any way, it produces the following error: The database server returned this error: SQLSTATE[HY000] [2013] Lost connection to MySQL server at 'reading initial communication packet', system error: 0
This is what I did to try to fix this:
restart instance
added authorized ip-addresses in CIDR notation
reset root password
restored backup
pinged the ip-address and I get response
All these actions completed but i'm still unable to connect through:
PHP
MySQL workbench
Ubuntu MySQL command line
All without luck. What could I do to repair my Cloud SQL instance. Is anyone else having this problem?
I'm from the Cloud SQL team. We are looking into this issue, it should be resolved soon. See https://groups.google.com/forum/#!topic/google-cloud-sql-announce/SwomB2zuRDo. Updates will be posted on that thread (and if there's anything particularly important I'll edit this post).
The problem seems to only affect connections from outside Google Cloud. Clients connecting from App Engine and Compute Engine should work fine.
Our company has same problem.
We are unable to connect through both MySQL workbench and MySQL command line.
Our Google Appengine application has no problems to connect since its not using external IP.
there.I encountered the same problem.You need to find out your public ip address,for that type "my public ip" in Google.Now click on your Cloud SQL instance that you created,under that click on ACCESS CONTROL tab and then click on Authorization tab under that.Under Authorized network,give any name you want to the network and copy your public ip address in the network.Now save changes and try to run the command from console.It should work fine.
I have installed DB2 10.5 version on my local Ubuntu 12.04 Machine. Now i need a GUI. I already tried squirrel-sql & Db-Visualizer. While Db-Visualizer give me the view-only database structure, squirrel-sql give me some more options to manage. But now I need a DB2 administrator tool, which can handle all this tasks plus backup/restore, import/export etc.
I have listen a lot for IBM Data Studio as de-facto tool for DB2. So I installed it. After install completion, I am unable connect to my DB2 databases/schemas. It is surprise As I am easily can connect my Dbs through squirrel-sql & Db-Visualizer but IBM Data Studio refuse to connect. It give following errors during try.
Full message content: [jcc][t4][2043][11550][4.17.30] Exception java.net.SocketException: Error opening socket to server localhost/127.0.0.1 on port 50,000 with message: Malformed reply from SOCKS server.
An attempt was made to access a database that was not found, has not been started, or does not support transactions.
Ensure that the specified database name exists in the system database directory. If the database name does not exist in the system database directory, either the database does not exist or the database name has not been cataloged. If needed, issue a db2start command and then resubmit the current command. SQL4499N A fatal error occurred that resulted in a disconnect from the data source. SQLSTATE: 08004
I have specified,
Local : Db2 for Linux, Unix & Windows
Database : <mydbname>
Host : localhost
Port Number : 50000
UserName : db2inst1
Password : XXXXXX
Default Schema : db2inst1
Anybody can suggest if extra steps needed to connect.
UPDATE : Pastebin Link for Stack Trace : http://pastebin.com/ySmrFKNV
UPDATE 1 : Search online for DB2 forums for same problem, Somebody suggested to check system proxy settings. So yes, My system have proxy settings enabled. But even after set proxy to NONE in Netwrok Settings in Ubuntu, problem still persists.
UPDATE 2 : Issue resolved after reinstallation of Data Studio. No idea what problem came, But now it working with same settings.
Not really a answer. But issue resolved after re-installation of Data Studio. No idea what problem came, But now it working with same settings.
I have a MySql database that is running on a linux server. The DB is not password encrypted.
I understand that no password != empty password.
I installed mysql workbenck on my windows laptop and am trying to connect to my database. It doesn't allow me to.
Details:
Connection method: Standard (TCP/IP)
Error: Cannot connect to Database server
Your connection attempt failed for user'root' from your host to server at 3306
Host is not allowed to connect to this MySql Server.
I am supposing it might be a windows firewall issue.
Please can somebody help me resolve this.
The error message says it clearly: the machine you are connecting from is not allowed to connect. In a MySQL server you can create users with specific IPs they can connect from. Often only localhost access is enabled (user#localhost or user#127.0.0.1 or user#::1), sometimes anyhost (user#%). In order to connect from your Windows machine your user must either be allowed to connect from any host or you need a specific user for the IP address of your Win machine.
The error because the mysql server is not starting in your computer.so you can start it manually..do the following steps,
1.download and install wamp server according to your bit version(32bit or 64bit) in your computer(http://wampserver-64bit.en.softonic.com/) this link allows you to download wamp server for 64bit.
2.As soon as you install it you can double click and run it..(you can see a icon in the right hand of the taskbar.It may be hide.so you can click the arrow which dhows you the hide apps runing).So click the icon and go to Mysql
3.Then go to Service and there you can find Start/Resume Services click on it..
4.And now it is done.Open mysql workbench and see.It will work..
You should create an specific user for accesing from your laptop:
CREATE USER 'youruser'#'machine.domain.com' IDENTIFIED BY 'your-password';
GRANT ALL PRIVILEGES ON *.* TO 'youruser'#'machine.domain.com' WITH GRANT OPTION;
Or you could create an user for accesing from anywhere
CREATE USER 'new_user'#'%' IDENTIFIED BY 'my-password';
GRANT ALL PRIVILEGES ON *.* TO 'new_user'#'%' WITH GRANT OPTION;