Support the ongoing development of Laravel.io →
Configuration Database
Last updated 1 year ago.
0

Glad to hear that my package is being used!

I've just played around with the migrations and I'm planning to add support for Google Cloud SQL. Still have some issues to resolve, mostly configuration options.

Anyway I did the following and was able to run migrations on Google Cloud SQL:

  1. Create an instance of Google Cloud SQL.
  2. Set the password for 'root' user.
  3. Add GAE applications allowed to access the instance.
  4. Enable IPv4 address for the instance.
  5. Add your IP address / range of IP addresses to be allowed to access the instance (can use 'what is my ip'.)
  6. Configure the production database parameters as follows:
'mysql' => array(
	'driver'	=> 'mysql',
	'unix_socket'=> '/cloudsql/gaeAppId:cloudSqlInstanceName'
	'host'		=> '',
	'database'	=> 'databaseName',
	'username'	=> 'root',
	'password'	=> '',
	'charset'	=> 'utf8',
	'collation'	=> 'utf8_unicode_ci',
	'prefix'	=> '',
),
  1. Configure the local database parameters as follows:
'mysql' => array(
	'driver'	=> 'mysql',
	'host'		=> 'XXX.XXX.XXX.XXX',	// The IPv4 address of the Cloud SQL Instance, see step 4.
	'database'	=> 'databaseName',
	'username'	=> 'root',
	'password'	=> 'password',	// The password for 'root' user, see step 2. 
	'charset'	=> 'utf8',
	'collation'	=> 'utf8_unicode_ci',
	'prefix'	=> '',
),

Of course using environment files '.env.php' (production) and '.env.local.php' (local) to store credentials is preferred.

Now you should be able to run the migrations in local environment and access your DB from the application running on GAE.

This is a procedure for Laravel 4. Laravel 5 procedure should be similar, but will include several changes.

Both Laravel 4 and Laravel 5 packages will have Google Cloud SQL support in near future.

You might want to look here for some references and Q/A https://github.com/shpasser/GaeSupport/issues/6

Best,

Ron.

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.