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

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;
主站蜘蛛池模板: 都江堰市| 砚山县| 鹤山市| 乐东| 游戏| 皮山县| 金塔县| 八宿县| 蕉岭县| 木兰县| 邵武市| 汉阴县| 高雄县| 高雄县| 湖南省| 平顶山市| 湘潭市| 丰镇市| 南川市| 建阳市| 得荣县| 弋阳县| 盘山县| 麻栗坡县| 连城县| 新竹市| 湘西| 福贡县| 邯郸县| 江永县| 剑川县| 偏关县| 铁岭县| 浦东新区| 广宁县| 赤壁市| 炎陵县| 岑溪市| 子长县| 彭阳县| 榆中县|