How to create database on google cloud sql instance

前端 未结 2 1191
抹茶落季
抹茶落季 2021-02-04 18:43

How can I use Cloud SQL to create a database? When I use MySQL, I could easily run a sql script to create them on phpMyAdmin.

I found a site that advertises that it\'s p

2条回答
  •  佛祖请我去吃肉
    2021-02-04 18:56

    UPDATE (2015-02-13): You can now use the Developer Console UI to manage your MySQL databases. Just go to your Cloud SQL instance page and click on the Databases tab.

    ORIGINAL ANSWER (still works): If you have a MySQL client installed it is fairly easy to connect to your Cloud SQL instance and create a new Database.

    1. Go to the Access Control section of your Cloud SQL instance.
    2. If you haven't done it, get an external IP Address.
    3. From the same page, set the password for the root user.
    4. Whitelist yourself by adding a new Authorized Network and entering your IP.

    Then, if you're using the standard mysql command line client, go a to a terminal and run

    mysql -uroot -p -h
    

    Or you can just use any client you want.

    Once you've connected to you database you can just CREATE DATABASE MyDatabase.

提交回复
热议问题