title: Google Cloud SQL - Catch bad logins
body: <p>I have an existing MySQL (version 5.7) instance hosted (managed) by Google Cloud SQL. I want to get a notification when someone is trying to connect my database with a bad username\password.</p>
  
  <p>My idea was to look for it on the Google Stackrive logs, but it's not there. </p>
  
  <p>There is an option to collect this information?</p>
  
  <h2>UPDATE 1:</h2>
  
  <p>I tried to connect the instance with gcloud but unfortunately, it's not working. </p>
  
  <pre><code>$ gcloud sql connect mydb
  Whitelisting your IP for incoming connection for 5 minutes...done.
  ERROR: (gcloud.sql.connect) It seems your client does not have ipv6 connectivity and the database instance does not have an ipv4 address. Please request an ipv4 address for this database instance.
  </code></pre>
  
  <p>It's because the database is accessible only inside the internal network. I searched for flags like <code>--internal-ip</code> but didn't find one. </p>
  
  <p>However, I was guessing that it's not making any difference if I'll try to access the database from my DB editor (workbench). So I did it:
  <a href="https://i.stack.imgur.com/QqviU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QqviU.png" alt="enter image description here"></a></p>
  
  <p>Searching for the query that @Christopher advised - but it's not there.</p>
  
  <p>What I missed?</p>
  
  <h2>UPDATE 2:</h2>
  
  <p>Screenshot of my Stackdrive:
  <a href="https://i.stack.imgur.com/L5Zci.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L5Zci.png" alt="enter image description here"></a></p>
  
  <p>Even if I remove this (<code>resource.labels.database_id="***"</code>) condition - the result is the same.</p>