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

Authorizing the client machine via Google Cloud Console

Get the IP address of the client machine by opening the browser and navigating to this URL: http://ipv4.whatismyv6.com/. Note down the IP address shown on this page for your machine. Open Google Cloud Console in a web browser by navigating to https://console.cloud.google.com. Navigate to the Cloud SQL service and choose the instance you want to connect to. Choose the AUTHORIZATION tab of the instance and click on the Add network button. Add the IP address shown as follows and click the Save button:

To access the Cloud instance of MySQL from your local machine, MySQL must be installed in the local machine. Now open the command-line Terminal and type the following command. The IP address of the MySQL server can be found in the Cloud Console, in the overview table of the MySQL instance. Type the password and connect to the server:

mysql --host=<server ip> --user=root --password

Once connected, type the first line of the code to see the list of databases on the server. Type the second line to choose the database you want and type the third line to see a list of tables in the database. Then type the fourth line to execute a sample query. Type the quit command to exit the MySQL console. The sample database and tables were created in Chapter 1, Google Cloud and Google BigQuery:

show databases;
use EmployeeMgmt;
show tables;
SELECT * FROM EmployeeDetails;
quit;

Use this option of authorizing networks for authorizing your app servers and other database servers, not developer machines. For developer machines, use the proxy option to connect to the MySQL instance on Google Cloud. Be sure to remove the networks from the Cloud Console if they are no longer valid for access.

主站蜘蛛池模板: 梓潼县| 分宜县| 芜湖市| 双城市| 新蔡县| 丹江口市| 江川县| 罗山县| 昭觉县| 广安市| 漳平市| 诸暨市| 保德县| 洪洞县| 天津市| 甘德县| 梅州市| 唐海县| 宁陕县| 淮北市| 延长县| 永吉县| 铜川市| 洛阳市| 保亭| 赣州市| 柳江县| 苏尼特左旗| 合水县| 喀喇| 南皮县| 木兰县| 武乡县| 利川市| 陇川县| 呼和浩特市| 诸城市| 安远县| 禹城市| 石景山区| 桃源县|