<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1257">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Hi Saulius, <br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Thanks for your fast and helpful reply! You're correct, that port is filtered for external connections. I have requested with our IT team to add an exception to allow this.
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">All the best,
</span><br>
<span style="font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">Dean</span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="font-family: "Courier New", monospace;">$ nmap -p 3306 sql.crystallography.net</span>
<div><br>
</div>
<div><span style="font-family: "Courier New", monospace;">Starting Nmap 6.40 ( http://nmap.org ) at 2022-04-13 11:18 BST</span></div>
<div><span style="font-family: "Courier New", monospace;">Nmap scan report for sql.crystallography.net (158.129.170.75)</span></div>
<div><span style="font-family: "Courier New", monospace;">Host is up (0.048s latency).</span></div>
<div><span style="font-family: "Courier New", monospace;">PORT STATE SERVICE</span></div>
<span style="font-family: "Courier New", monospace;">3306/tcp filtered mysql</span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Saulius Gražulis <grazulis@ibt.lt><br>
<b>Sent:</b> 13 April 2022 11:09<br>
<b>To:</b> Keeble, Dean (DLSLtd,RAL,LSCI) <dean.keeble@diamond.ac.uk>; cod-bugs@ibt.lt <cod-bugs@ibt.lt><br>
<b>Subject:</b> Re: [Cod-bugs] cannot connect through mysql</font>
<div> </div>
</div>
<div>
<div class="x_moz-cite-prefix">Dear Dean,</div>
<div class="x_moz-cite-prefix"><br>
</div>
<div class="x_moz-cite-prefix">thank you for your inquiry!<br>
</div>
<div class="x_moz-cite-prefix"><br>
</div>
<div class="x_moz-cite-prefix">On 2022-04-13 12:33, Keeble, Dean (DLSLtd,RAL,LSCI) wrote:<br>
</div>
<blockquote type="cite">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
I'm investigating how to perform some searches in the COD programmatically via the mysql interface. In following the example
<a href="https://wiki.crystallography.net/howtoquerycod/" title="https://wiki.crystallography.net/howtoquerycod/">
online </a>I'm not managing to connect, however. Do you have any advice on how I might proceed? Below I show results of a ping (success), the mysql (with the error) and my mysql version.
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Many thanks in advance for your help! <br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
All the best, <br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Dean<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<span style="font-family:"Courier New",monospace">$ ping -c 1 sql.crystallography.net</span>
<div><span style="font-family:"Courier New",monospace">PING sql.crystallography.net (158.129.170.75) 56(84) bytes of data.</span></div>
<div><span style="font-family:"Courier New",monospace">64 bytes from 158.129.170.75 (158.129.170.75): icmp_seq=1 ttl=46 time=47.7 ms</span></div>
<div><br>
</div>
<div><span style="font-family:"Courier New",monospace">--- sql.crystallography.net ping statistics ---</span></div>
<div><span style="font-family:"Courier New",monospace">1 packets transmitted, 1 received, 0% packet loss, time 0ms</span></div>
<div><span style="font-family:"Courier New",monospace">rtt min/avg/max/mdev = 47.777/47.777/47.777/0.000 ms</span></div>
<div><span style="font-family:"Courier New",monospace"><br>
</span></div>
<div><span style="font-family:"Courier New",monospace">$ mysql -u cod_reader -h sql.crystallography.net -e 'select count(*) from data where flags like "%has Fobs%"' cod | cat</span></div>
<div><span style="font-family:"Courier New",monospace">ERROR 2003 (HY000): Can't connect to MySQL server on 'sql.crystallography.net' (110)</span></div>
<div><span style="font-family:"Courier New",monospace"><br>
</span></div>
<div><span style="font-family:"Courier New",monospace">$ mysql --version</span></div>
<div><span style="font-family:"Courier New",monospace">mysql Ver 15.1 Distrib 5.5.68-MariaDB, for Linux (x86_64) using readline 5.1</span></div>
</div>
</blockquote>
<p>All your commands seem OK. I have tested your SQL query on my machine, and it works as expected from my location:</p>
<p></p>
<blockquote type="cite"><font face="monospace">saulius@tasmanijos-velnias 2022-USNC-Cr-Database-Workshop-III/ $ mysql -u cod_reader -h sql.crystallography.net -e 'select count(*) from data where flags like "%has Fobs%"' cod | cat<br>
count(*)<br>
57568</font><br>
</blockquote>
<p></p>
<p>As Andrius pointed out, the reason why the command does not work for you might be a firewall.
<br>
</p>
<p>I could add to that that need the TCP port 3306 open to be able to access mysql directly:</p>
<p></p>
<blockquote type="cite"><font face="monospace">saulius@tasmanijos-velnias 2022-USNC-Cr-Database-Workshop-III/ $ grep mysql /etc/services
<br>
mysql 3306/tcp</font><br>
</blockquote>
<p></p>
<p>Please check with your site admin if they have blocked that port (if you are in Diamond, this could be the case the sysadmins are simtimes be extra-cautious at large facilities...); if they have, maybe they can open the port for you. In addition to that,
you may want to check the same command though your home Internet provide or via you mobile phone.<br>
</p>
<p>HTH,<br>
Saulius<br>
</p>
<pre class="x_moz-signature" cols="72">--
Dr. Saulius Gražulis
Vilnius University, Life Science Center, Institute of Biotechnology
Saulėtekio al. 7, LT-10257 Vilnius, Lietuva (Lithuania)
phone (office): (+370-5)-2234353, mobile: (+370-684)-49802, (+370-614)-36366
</pre>
<br>
-- <br>
This message has been scanned for viruses and <br>
dangerous content by <a href="http://www.mailscanner.info/"><b>MailScanner</b></a>, and is
<br>
believed to be clean. </div>
<p align="justify"> </p>
<p align="justify">-- </p>
<p align="justify">This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.<br />Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. <br />Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.<br />Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom<br /> </p><br />--
<br />This message has been scanned for viruses and
<br />dangerous content by
<a href="http://www.mailscanner.info/"><b>MailScanner</b></a>, and is
<br />believed to be clean.
</body>
</html>