This is not a JPA issue. everything you talked about has to do with the Eclipse
IDE. I think that the connection is being attempted by the Eclipse Database Explorer plugin, but I don't let Eclipse do all my thinking for me, so I haven't used those options.
You need to make sure that you are attempting to connect to the correct database host, whether that's localhost or some other machine on the network. You need the exact same parameters that you were using for the MySQL Workbench, which is hostname, database userid, password, and port number. The JDBC URL contains most of that information, although userid and password can also be set as external parameters (and should be, actually).
You need to do this in two places. One is for the developer functions in the Eclipse IDE, such as the Database Explorer. The other place it has to be set correctly is in the application, because when the application is installed on a production server, Eclipse will not be available there. For a webapp server, in fact, the recommended procedure is to use a database connection pool, which is part of the webapp server configuration. JPA can then use that pool. For standalone apps, you can obtain a connection via the DriverManager, among other possibilities.
In any event, the necessary connection data is the same regardless of whether you're talking to the IDE, a webapp server, or a standalone application.