Local MySQL in Google App Engine

1 view
Skip to first unread message

Sarath Babu via StackOverflow

unread,
Nov 8, 2014, 12:41:28 AM11/8/14
to google-appengin...@googlegroups.com

Is it possible to work with Google App Engine just with local MYSQL and not using Cloud SQL?

Class.forName("com.mysql.jdbc.Driver");
Connection connect = DriverManager
                 .getConnection("jdbc:mysql://localhost:3306/mydatabase?user=root");

the above code gives me error

java.lang.ExceptionInInitializerError
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:579)
at java.sql.DriverManager.getConnection(DriverManager.java:243)


Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/26814163/local-mysql-in-google-app-engine

user1258245 via StackOverflow

unread,
Nov 8, 2014, 1:11:40 AM11/8/14
to google-appengin...@googlegroups.com

During development, yes you can. But you need to configure it in appengine-web.xml.

<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
  ...
  <use-google-connector-j>true</use-google-connector-j>
</appengine-web-app>  

// Local MySQL instance to use during development.

   Class.forName("com.mysql.jdbc.Driver");
    url = "jdbc:mysql://127.0.0.1:3306/guestbook?user=root";


Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/26814163/local-mysql-in-google-app-engine/26814327#26814327
Reply all
Reply to author
Forward
0 new messages