How to connect to MySQL Server from AnyLogic?
At first, please add Database component to your model and then follow the instructions below to connect AnyLogic model to the MySQL database: • Download the required driver (zip archive) from: http://dev.mysql.com/downloads/connector/j/5.1.html • Copy all driver files to the model’s folder. • Open the model in AnyLogic, select it in the Projects view and import driver JAR file on Dependencies tab. • Go to the advanced properties of Main and type the following line in Import section: import com.mysql.jdbc.Driver; • Select database and type com.mysql.jdbc.Driver in JDBC driver property. • Connection URL should look like the following: jdbc:mysql://host:port host – is the ip address of the database, e.g. 18.40.10.8 port – the default value is 3306 • Specify login and password for the database.