Cannot redeploy Rancher server using external db

I’m trying to redeploy Rancher-server with an external db restored from backup. getting Cannot create JDBC driver of class '' for connect URL 'null'

I’ve started a mysql:5.5 instance. Imported the rancher db from mysqldump and done flush privileges. If I run the rancher server it gives the above error

CATTLE_AGENT_PACKAGE_AGENT_BINARIES_URL=/usr/share/cattle/artifacts/agent-binaries.tar.gz
CATTLE_AGENT_PACKAGE_CADVISOR_URL=/usr/share/cattle/artifacts/cadvisor.tar.gz
CATTLE_AGENT_PACKAGE_HOST_API_URL=/usr/share/cattle/artifacts/host-api.tar.gz
CATTLE_AGENT_PACKAGE_NODE_AGENT_URL=/usr/share/cattle/artifacts/node-agent.tar.gz
CATTLE_AGENT_PACKAGE_PYTHON_AGENT_URL=/usr/share/cattle/artifacts/python-agent.tar.gz
CATTLE_AGENT_PACKAGE_RANCHER_DNS_URL=/usr/share/cattle/artifacts/rancher-dns.tar.gz
CATTLE_AGENT_PACKAGE_RANCHER_METADATA_URL=/usr/share/cattle/artifacts/rancher-metadata.tar.gz
CATTLE_AGENT_PACKAGE_RANCHER_NET_URL=/usr/share/cattle/artifacts/rancher-net.tar.gz
CATTLE_CATTLE_VERSION=v0.165.8
CATTLE_DB_CATTLE_DATABASE=cattle
CATTLE_DB_CATTLE_MYSQL_HOST=mysql
CATTLE_DB_CATTLE_MYSQL_NAME=cattle
CATTLE_DB_CATTLE_MYSQL_PORT=3306
CATTLE_DB_CATTLE_USERNAME=cattle
CATTLE_GRAPHITE_HOST=
CATTLE_GRAPHITE_PORT=
CATTLE_HOME=/var/lib/cattle
CATTLE_HOST_API_PROXY_MODE=embedded
CATTLE_LOGBACK_OUTPUT_GELF_HOST=
CATTLE_LOGBACK_OUTPUT_GELF_PORT=
CATTLE_RANCHER_COMPOSE_VERSION=v0.8.6
CATTLE_RANCHER_SERVER_IMAGE=rancher/server
CATTLE_RANCHER_SERVER_VERSION=v1.1.2
CATTLE_USE_LOCAL_ARTIFACTS=true
DEFAULT_CATTLE_API_UI_INDEX=//releases.rancher.com/ui/1.1.12
DEFAULT_CATTLE_CATALOG_EXECUTE=true
DEFAULT_CATTLE_CATALOG_URL=library=https://github.com/rancher/rancher-catalog.git,community=https://github.com/rancher/community-catalog.git
DEFAULT_CATTLE_COMPOSE_EXECUTOR_EXECUTE=true
DEFAULT_CATTLE_MACHINE_EXECUTE=true
DEFAULT_CATTLE_RANCHER_COMPOSE_DARWIN_URL=https://releases.rancher.com/compose/v0.8.6/rancher-compose-darwin-amd64-v0.8.6.tar.gz
DEFAULT_CATTLE_RANCHER_COMPOSE_LINUX_URL=https://releases.rancher.com/compose/v0.8.6/rancher-compose-linux-amd64-v0.8.6.tar.gz
DEFAULT_CATTLE_RANCHER_COMPOSE_WINDOWS_URL=https://releases.rancher.com/compose/v0.8.6/rancher-compose-windows-386-v0.8.6.zip
11:00:02.529 [main] WARN  o.e.jetty.security.SecurityHandler - ServletContext@o.e.j.w.WebAppContext@3db43dd2{/,file:/usr/share/cattle/be21b2bf0c1a2d74b75c887ce9982c6e/,STARTING}{file:/usr/share/cattle/be21b2bf0c1a2d74b75c887ce9982c6e/} has uncovered http methods for path: /
11:00:03.440 [main] INFO  ConsoleStatus - [1/6] [1ms] [0ms] Loading config-bootstrap
11:00:03.582 [main] INFO  ConsoleStatus - [2/6] [144ms] [140ms] Loading base-config
11:00:03.786 [main] INFO  ConsoleStatus - [3/6] [348ms] [204ms] Loading config
11:00:03.792 [main] INFO  ConsoleStatus - [4/6] [354ms] [6ms] Starting config-bootstrap
11:00:03.914 [main] ERROR i.c.p.a.sources.LazyJDBCSource - Failed to get connection to database, will retry for 5 minutes
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'

IF I run the same but to a shell I can connect just fine:

root@440cab674df4:/# mysql -h$CATTLE_DB_CATTLE_MYSQL_HOST -u$CATTLE_DB_CATTLE_MYSQL_NAME -p$CATTLE_DB_CATTLE_PASSWORD $CATTLE_DB_CATTLE_DATABASE
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.5.50 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

Mot sure what to try now