title: How to reconnect Node App to new Google Cloud SQL Database?
body: <p>A development version of a react/node app is in a gcp project. This project was created by someone else who left so I have limited understanding. I need to get this app ready for production.</p>
  
  <p>I took the code and copied this app over to a new project which will be used for production. Inside the server.js file I changed the host, password, and database to match the database in the new project I created.
  When the do npm run build inside client and do gcloud app deploy api/app.yaml and client/app.yaml the deployed app still references the original database from the development app despite specifying new host,password, and database.</p>
  
  <p>I'm guessing the problem is I originally deployed it using the dev database options, and when I switch to the prod database options, it fails to connect and reverts to the previous connection.</p>
  
  <p>If this is true, how can I see what is causing this connection failure? Is there other settings I need to set in the database to make it connection ready. All I did was create a database of the same name in a new project.</p>
  
  <pre><code>var connection = mysql.createConnection({
    host: 'xx.xxx.xxx.xxx',
    user: 'root',
    password: 'xxx',
    database: 'xxx',
    multipleStatements: true
  });
  
  connection.connect(function(err) {
      if (err) throw err;
  });
  
  module.exports = connection;
  
  
  </code></pre>