0
我已经在ServiceDefinition文件中使用以下WorkerRole元素创建了一个辅助角色。我将C:\ Program Files文件(x86)\ MySQL \ MySQL Server 5.5文件夹复制到一个名为mysql的worker角色文件夹下的文件夹中,当我运行cspack和csrun时,它启动了模拟器,但它启动并停止角色,它有时不工作,它说拒绝访问@ localhost但是。感谢您的帮助通过工作角色在Windows Azure上安装mysql
<WorkerRole enableNativeCodeExecution="true" name="MyPhpProj_MyWorkerRole" vmsize="Small">
<LocalStorage name="E2EStorage" cleanOnRoleRecycle="false" />
<Endpoints>
<InternalEndpoint name="PeerEndpointIn" protocol="tcp" />
<InternalEndpoint name="MasterElectionService" protocol="tcp" />
<InternalEndpoint name="MySQL" protocol="tcp" />
<InternalEndpoint name="InstanceManagerEndpontIn" protocol="tcp" />
</Endpoints>
<Runtime executionContext="limited">
<EntryPoint>
<ProgramEntryPoint commandLine="./mysql/bin/mysql.exe" setReadyOnProcessStart="true" />
</EntryPoint>
</Runtime>
<Imports/>
<LocalResources>
<LocalStorage cleanOnRoleRecycle="false" name="MySQL" sizeInMB="260"/>
<LocalStorage cleanOnRoleRecycle="false" name="MySQLDatastore" sizeInMB="20"/>
</LocalResources>
<ConfigurationSettings>
<Setting name="InitFile"/>
<Setting name="LogLevel"/>
<Setting name="ScheduledTransferPeriodInSeconds"/>
<Setting name="WindowsAzureStorageConnectionString"/>
</ConfigurationSettings>
</WorkerRole>
谢谢你的回答,所以你认为我所做的是对的。我可以让它工作,我只是想说它有时会产生错误。我只想确保我在WA上安装MySql所做的是正确的。 – user217648
是的,你已经做得非常正确。您也可以将RDP添加到您的实例,然后验证MySql实例是否正在运行,并且您是否可以运行相同的脚本来验证连接。 – AvkashChauhan
我放弃使用EntryPoint和Mysql.exe,因为我总是得到相同的错误(odbc访问被拒绝),我不知道如何创建您所谈论的批处理文件。相反,我使用eclipse来创建一个dll的工作者角色,并且我在cspack命令中添加了入口点到该dll。现在当我去计算模拟器显示绿色和以下复制文件夹mysql \数据到C:/Users/ksaleh.CORP/AppData/Local/dftmp/Resources/60df05e6-005a-46ac-ae22-eedb22f178cc/directory/MySQLDatastore/ 信息:MySQLIP = 127.255.0.0 信息:MySQLPort = 20000 information:working; 如何连接这个mysql服务器? – user217648