How to use mySql DB from C# on shared hosting? - mysql

i bought a web domain with some web space. They support only mySQL DB, how do i access the my SQL DB on my asp.net application? is there is way to access it through .net base classes without installing third party drivers?

You can reference MySQL .net connector .dll which will be placed in your bin folder.

The standard Conector/Net should work. It's pure C# and communicates with MySQL over sockets. If that isnt supported you should talk to your host about how to get it working.

Related

SQL adapter in Worlight?

I am new to IBM Worklight,and i found a way to connect to the MySQL using the SQL adapter.
the configuration as below:
<dataSourceDefinition>
<driverClass>com.mysql.jdbc.Driver</driverClass>
<url>jdbc:mysql://localhost:3306/worklight_training</url>
<user>Worklight</user>
<password>Worklight</password>
</dataSourceDefinition>
Since the adapter are compile together with the app, just wondering, is it safe? is there a possibility of someone decompiling my apk or ipa to view the adapter connection thus acquire the user and password to my mysql database.
A hacker decompiling your .apk or .ipa file will not find the database username/password there, for the simple reason that the adapter is not compiled "together with the app" and is not part of any artifacts that you install in a device.
An adapter is a server-side entity, not client-side.
The adapter is an object stored in the memory of the running application server.
Adapters are Server side code andare not part of the apk or ipa files.
You can check/confirm this information in Worklight documentation. The details about adapters, under "Developing the server side of a Worklight Application" are at:
http://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.dev.doc/devref/c_overview_of_ibm_worklight_adap.html
You can also check the Server Side Development of MobileFirst Platform Getting Started Modules
https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-6-3/server-side-development/
(MobileFirst Platform is the new name of Worklight)
In worklight, you usually have the application (apk/ipa) communicating with a server side component (the adapters) running in a worklight server. The adapters are used to communicate with backend systems (like a mysql server). There are a few different types of adapters to communicate with different types of backends (like sql, http and SAP)
Please, let us know what documentation/guide caused you the understanding that adapters are part of the client apk/ipa. If that is really stated in any documentation, it is wrong and must be corrected.
Edit:
To connect to a MySQL DB (no matter if it is a standalone MySQL or in XAMP, LAMP or whatever package) you can follow this geting started tutorial
https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-6-3/server-side-development/sql-adapter-communicating-sql-database/
Also note that, if you are using MobileFirst Studio (previously Worklight Studio) downloaded for free from Developer Works you have a developer version of the WOrklight Server running inside Studio so that you can create and deploy adapters and use it during development as your server. But when you go to production you are required to purchase licenses of Worklight because you don't have the worklight server available for free.
So if you have Studio, you have the server available but only for development purposes.

delphi: connecting to hosted mysql server over internet

What is the most secure and effecient method of connecting a Delphi program to a MySQL database hosted on an Apache server from my web hosting provider.
Ideas, hints or any information regarding the above, preferably using dbExpress with Delphi 2010 will be highly appreciated.
Thanks
Well you cant connect directly because of the security issues but there are a couple,
Write a web-service that catches the request and send back you the
response.
write a php script that gets the requests and gives back responses.
if you are hosting on a windows server you can connect via VPN that
will give you a direct sql connection and still be secure.
You can connect directly MySQL Database. I recommend using FireDAC component.
About FireDAC :
FireDAC Multi-Device Data Access Library
Universal Enterprise Data Connectivity
FireDAC is a Universal Data Access library for developing applications for multiple devices, connected to enterprise databases. With its powerful universal architecture, FireDAC enables native high-speed direct access from Delphi and C++Builder to InterBase, SQLite, MySQL, SQL Server, Oracle, PostgreSQL, DB2, SQL Anywhere, Advantage DB, Firebird, Access, Informix, DataSnap and more.
FireDAC Data Access Components
Also you can use MySQL Data Access Components (MyDAC or UniDAC) :
About MyDAC Component:
MySQL Data Access Components (MyDAC) is a library of components that provides direct access to MySQL from Delphi, C++Builder, Lazarus (and Free Pascal) on Windows, Mac OS X, iOS, Android, Linux, and FreeBSD for both 32-bit and 64-bit platforms. Applications based on MyDAC can connect directly to MySQL server or work through the MySQL client library. MyDAC is designed to help programmers develop faster and cleaner MySQL database applications.
MySQL Data Access Components
If you want connect MySQL with dbExpress (i don't recommend it)
You need dbexpress driver for MySQL dbxmys.dll and alos MySQL client library libmySQL.dll.
I use MySQL as a remotely accessed DBMS from Go Daddy web hosting. Unidac is used to connect to the remote data set no problem. I then use a signed VCL component based GUI on the client side.
The VCL based GUI blows the doors off all other web based applications (including .NET). All the functionality of the Delphi application works flawlessly but I perform all DBMS functions to a remotely hosted MySQL database. I really appreciate this combination of technologies that allows me to produce the most robust applications possible.

How to change the database which is used to store liferay content?

I have a glassfish server built with company default script. Then I have Liferay installed upon it. Liferay uses some predefined database to store the content on the pages it shows. It is a company shared database don't know where. How could I connect my liferay to a local clean database?
My setup is a Glassfish with Liferay, the DatabaseI use is MySQL.
Thanks for any help!
It's all explained here:
http://www.liferay.com/community/wiki/-/wiki/Main/Database+Configuration

create and restore a mysql db using a setup project (installer) in VS.Net

What is the best practice for creating an installer for a winform application.
The application is supposed to install the following without connecting to internet.
.Net Framework 3.5sp1
MySQL Server
My SQL Connector
Restore Mysql db
Update Config file with the MySQL uname/pwd.
I have all the msi files for installing the above mentioned items. But am wondering about the best practice to create the installer.
Thanks in advance,
Hi I came up with a similar situation. Firstly you should have .NET framework offline installer which can be downloaded from http://www.microsoft.com/downloads/en/details.aspx?FamilyID=992cffcb-f8ce-41d9-8bd6-31f3e216285c. I assume you are using visual studio installer. There are couple of choices but I prefer to copy the offline .NET installer to the setup projects output directory and from requirements on target machine tab I set the install URL property of .NET framework the exact name of offline setup file. As described in the figure.
So the installer does not try to connect to a remote computer to download .NET framework and install it however I think it is more appropriate that it connects to a Microsoft server and installs it. Anyways the next step is to configure the MySQL server. MySQL is really generous for me since they support a fully documented noinstall files. You can find the document here: http://dev.mysql.com/doc/refman/5.5/en/windows-install-archive.html
Using a noinstall zip archive you can copy the dbengine core files to any folder on the clint machine. And change the configuration parameters of MySQL. You can name the MySQL service anything you want. Start the the service and create tables. You can do all of this stuff from custom actions tab of the setup project choosing the appropriate script files or you can write code for it. The beautiful thing is that your customer does not need to know that he/she is installing a database engine on the target machine. I hope this helps. Thanks.

Visual Studio and MySQL

I have been using Microsoft Visual Web Developer 2008 Express Edition. Originally, I made a website with a MySQL back-end. Then I discovered the .Net web authentication, and moved to MS Access as I could, with some modification, make the web authentication work (but not all the features). For a future release of my site, I moved to MS SQL as it supported all of the features of the .Net web authentication. However, my host does not support MS SQL, my host supports MS Access and MySQL.
If I get Visual Studio 2008 Standard, with it have better integration with MySQL, to the point that all features of web authentication and using the development environment to make changes to the database are supported? Are there thrid-party tools or modifications that I can make to get things to that level of integration?
Or, do I have to move to a host that supports MS SQL?
We run a .NET environment here but using MySQL as our backend (though our software is applications, not web apps).
The MySql Net Connector is basically the MySQL version of the System.Data namespace in .NET (with nearly identical functionality/naming except for the MySql prefixes). So, as far as I have seen while working with it, anything that you can do via those namespaces, you can do via the connector.
As for IDE integration, I don't know. I use MySql Administrator and SQLYog to manage/work with the db.
You could try MySQL's .NET connector, though it's only a development version