Sabish.M
Sabish.M

Reputation: 2060

How to connect Google Cloud Sql from Website hosted in Godaddy?

Now i successfully connect the cloud sql with app engine. I am not interested to get the data via the app engine. Is possible to directly communicate between google cloud sql from website.

<?php

require dirname(__DIR__) . '/vendor/autoload.php';

$conn = mysqli_connect('localhost', 'root', 'password', 'db_name');

if ($conn->connect_error) {
    echo "Unable to connect. Error: ".$conn->connect_error;
    $conn = null;
}

?>

Please advise me.

Thank you.

Upvotes: 0

Views: 260

Answers (1)

John Hanley
John Hanley

Reputation: 81464

Cloud SQL is a managed database service will numerous features to make fault-tolerance, availability and management easy. I prefer this to monitoring MySQL myself.

Here is a link to a getting started how-to page for PHP.

Using Cloud SQL for MySQL with PHP

Upvotes: 1

Related Questions