官术网_书友最值得收藏!

  • Learning Google BigQuery
  • Thirukkumaran Haridass Eric Brown
  • 225字
  • 2021-07-02 21:24:04

Connecting using a proxy script

Google provides a proxy script for Windows, macOS, and Linux OS for connecting tot he MySQL instance on Google Cloud. The following section provides an overview of how to install and setup the proxy script for various OS:

  • For Linux, download the script using the following command from the Terminal and make it executable using the command in the second line:
wget https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 -O cloud_sql_proxy
chmod +x cloud_sql_proxy
  • For macOS, download the script using the following command from the Terminal and make it executable using the command in the second line:
curl -o cloud_sql_proxy https://dl.google.com/cloudsql/cloud_sql_proxy.darwin.amd64
chmod +
x cloud_sql_proxy
  • Run the proxy script with the following parameters. The instance parameter accepts both the Cloud SQL instance name and IP address:
./cloud_sql_proxy -instances=<ip address or instance name>=tcp:3306
  • If the proxy starts successfully, the message shown in following screenshot will appear. If the port 3306 that is used by the proxy is already in use by your local instance, then stop the local instance if you can or use a different port for the proxy:
  • Open another Terminal and connect to the Cloud SQL instance using the following command; execute the following commands to see the objects in the server:
mysql --host=<server ip> --user=root --password
show databases;
use EmployeeMgmt;
show tables;
SELECT * FROM EmployeeDetails;
quit;
主站蜘蛛池模板: 黄龙县| 九寨沟县| 云和县| 黑河市| 昌图县| 汉源县| 宁都县| 贵定县| 木里| 郎溪县| 贵阳市| 右玉县| 万州区| 台东县| 徐汇区| 永泰县| 鲁山县| 惠水县| 马边| 达尔| 横山县| 万州区| 平山县| 澄江县| 什邡市| 横峰县| 清丰县| 渑池县| 克山县| 忻州市| 英德市| 陆川县| 琼海市| 托克托县| 朝阳区| 南郑县| 崇义县| 台前县| 邯郸县| 灌阳县| 洞头县|