问题
Hihi, I have setup an Ubuntu instance in Amazon EC2, and I have setup MySQL under Ubuntu. Would like to ask, how can I connect my external asp.net application to this MySQL database? What should be the connection look like?
I am using Entity Framework 4. Thanks in advance!
回答1:
Have figured out the connection string format as follow:
<add name="ejabberdEntities" connectionString="metadata=res://*/ejabberdDB.csdl|res://*/ejabberdDB.ssdl|res://*/ejabberdDB.msl;provider=MySql.Data.MySqlClient;provider connection string="server=ec2-xx-xx-xxx-xx.compute-x.amazonaws.com;User Id=dbuser;Password=dbpassword;database=ejabberdDB;Port=3306;Persist Security Info=True"" providerName="System.Data.EntityClient" />
:)
来源:https://stackoverflow.com/questions/6855653/connection-string-to-connect-to-mysql-setup-under-ubuntu-in-amazon-ec2