0

I am trying to connect to my Google Cloud instance in mysql client as stated in https://cloud.google.com/sql/docs/mysql/connect-admin-ip#connect with the command

mysql --host=[INSTANCE_IP] --user=root --password

and the syntax error shows up as below. What is wrong with the syntax? Mysql client version is 8.0

enter image description here

2 Answers2

0

As far as I understand you want to connect to a Cloud MySQL instance to see that everything is OK in order to go ahead and connect your C# code to it.

If you are seeing "mysql>" is because you are connected to that instance.

enter image description here

Stefan G.
  • 890
  • 5
  • 10
  • I am trying to connect my C# app to the google cloud sql according to this answer https://stackoverflow.com/a/52458418/11960582.. and the c# coding output with error 'Unable to connect to any of the specified MySQL hosts' so i thought the problem would be in connecting to the instance –  Nov 12 '19 at 08:32
0

As previous answer stated by Stefan G. you're already in the mysql tool. You may or may not be actually connected to the server though. When you have that prompt mysql> type status. It'll tell you whether or not you're connected to an instance or not. There will be a Connection: field in the status output which should be the IP address of your instance.

If it's NOT, then something went wrong at the connection step, and you'll need to run connect <databasename> where is the id of one of the datbases in your instance. See if that errors out as well, and if it does, there's something deeper wrong going on here.

If you ARE connected to the database, you should be able to run SHOW tables; and have it list the tables in your database.

Gabe Weiss
  • 3,134
  • 1
  • 12
  • 15