Hi Dave,
The hash/pound sign (#) means the beginning of a URL fragment. In Connector/J connection strings this means that whatever comes next is ignored.
So, the correct connection string for you should be:
jdbc:mysql://localhost:3306/mydatabase?serverTimezone=Europe/London&connectTimeout=5&socketTimeout=0&autoReconnect=true
The port reference (3306) is optional and if you don't provide one Connector/J will use 3306 by default (MySQL server's default port). If your server is running on a different port, then you need to identify it. The same is true for the host name. If you don't provide one, Connector/J uses "localhost" by default.
Then, your connection string could be:
jdbc:mysql://localhost/mydatabase?serverTimezone=Europe/London&connectTimeout=5&socketTimeout=0&autoReconnect=true
Or:
jdbc:mysql://:3306/mydatabase?serverTimezone=Europe/London&connectTimeout=5&socketTimeout=0&autoReconnect=true
Or even:
jdbc:mysql:///mydatabase?serverTimezone=Europe/London&connectTimeout=5&socketTimeout=0&autoReconnect=true
In which case both host name and port take the default values.
Mind that this is true for Connector/J 8.0. Connector/5.1 connection string parser may behave differently.
IHTH