php - Can't connect MySQL after deploying app on AppEngine -
can me fix , wrote simple code test mysql connection , work on locally can't connect mysql after deployed on app engine.
file app.yaml:
application: testmysql07 version: 1 runtime: php55 api_version: 1 threadsafe: yes handlers: - url: /favicon\.ico static_files: favicon.ico upload: favicon\.ico - url: .* script: main.php
file main.php:
<?php $hostname = "localhost"; $username = "root"; $password = ""; $databasename = "web_bb"; $conn = mysql_connect($hostname,$username,$password,$databasename) or die("can't connect mysql"); echo "successful </br>"; mysql_select_db($databasename,$conn); ?>
sorry i'm not in speaking english
to connect local mysql database during development, you'll need
- enable billing app. allows use sockets connect remote servers.
- make sure local mysql database reachable internet, i.e. having correct firewall/nat settings in router.
- use public ip address
$hostname
in code.
Comments
Post a Comment