I have finished developing the first release of my application which uses MySQL (locally under one license and hosted under another).
Connecting the application to the hosted database works fine, i edit the connection details within my application to the hosted server details and it works fine.
However, when I try and use it locally (server:localhost etc..) i get an error stating it can not access the server. In my application, i have included the mysql DLL files, but I would prefer the user not to have to install MySQL server which is about a 100MB download (i know its quite small these days but want the install to be as pain free as possible).
I know it would be an easy fix just to add this install as a prerequisite, but i am sure there is a way to do it without this, or maybe not. Is there a script i can run which will run through and setup the server with users etc?
Any help is appreciated.
Thanks
Shaun
Connecting to a local mysql database implies there's a mysql database service running and was previously installed.
If you want a database you can distribute with your program without having to install a fully fledged database there are quite a few around such as MSSQLCE.
But otherwise, your user is going to have to install mysql on his own machine and keep it running.
Or you could use SQLLite, which is what i have had the best experience with so far.
It should be easy to refactor your Program to use this, and it takes no user setup to use it.
Hope this helps :)
Related
I write small apps to help automate daily work of some colleagues and want to put on a shared folder on my machine so that others from local network can execute when my computer is on. I don't have the luxury of my own server so this is the best I can do.
One of which is a Winform app that connects to an Oracle database via an Oracle client and Oracle Data Access installed on MY machine to retrieve information. I would hope that people can execute the app (.exe file) when my machine is on, without installing anything on their machine. The app will write to an output file (.html) on the same folder and open it on THEIR browser.
My question is : What should I do to make it possible ? How can people run this .exe file using Oracle Client, Oracle DataAccess and .Net framework already installed on MY machine as if I am running it locally.
I mark all C# Assemblies (automatically added by Visual Studio) as Copy Local to True (Microsoft.CSharp.dll, System.Data.dll, System.dll, System.Data.DataSetExtensions.dll, System.Deployment.dll, System.Drawing.dll, System.Net.Http.dll, System.Windows.Forms.dll, System.Xml.dll, System.Xml.Linq.dll). Would people still need .Net framework installed ? My app is quite simple with only one external dll Oracle.DataAccess.dll. How about Oracle client and Oracle Data Access.
Many thanks.
Best solution for your situation is create a webservice and make the clients that'll consume your webservice instead of them making direct calls to your database. It removes system dependencies and easier maintenance.
Your colleagues can go to your computer via remote desktop if it is feasible. In the probable case that this is not feasible, you need to decide what the colleagues will see. If they only need to see the generated html and they only need to trigger the execution of your exe, then you will need to have a program which listens to a port and make sure that the given port is requested correctly by your colleagues via a small client app.
But honestly, the use-case you describe sounds like a website used by your colleagues. You can create a website in .NET, the exe you have would be the controller or code-behind depending on the approach you use and the HTML would be the response. Then the colleagues will just request your page with the port you are listening at.
I've been given the task of running a program that relies on a MySQL database, specifically, the 3.23.42 version. I have to install MySQL, run a .batch file that reads an SQL file (to create the required tables and such), then run the program. Seems simple enough.
I got as far as installing MySQL. I was expecting it to ask username and passwords and such, as was my experience with installing SQL Server and MySQL version 5 (and later), but it needed nothing from me. Attempts to run the .batch file, however, yields the error:
"MySQL Error 2003: Can't connect to MySQL server on 'localhost' "
So I ran Command prompt as an administrator, went to the MySQL directory, and ran "mysql". It gave me the same error as above.
Running the commands "mysqld-nt" or "mysqld" didn't do anything, so I'm assuming there's another problem at work here. Neither did I find any 'mysql' in the running services or process.
At this point, it doesn't matter if the program runs or not. I need the database up and running first.
Although I've used MySQL before, I can't say I have that much experience with it, and it had always been up and running already; this is the first time I'm deploying it myself.
Of note is that:
I haven't tried to reinstall the program yet, although I'm not sure if it will fix anything.
I've installed MyODBC-3.15.05, if it means anything (part of the instructions).
I'm using Windows 7, 32-bit (I have heard MySQL doesn't like to play nice with Windows 7).
I'm using this setup as both the server and the client; had the entire process been successful, I was to do the same thing on another computer. No computer actually uses another as a server.
I don't exactly know what services to look for in the services list.
Is there anything I can do to fix this problem?
Early versions of the MySQL installer didn't set up the windows service at all.
You might have to do it by hand.
http://dev.mysql.com/doc/refman/5.1/en/windows-start-service.html
When the service is installed you should be able to enter the following command to start the service.
net start mysql
Then all you need is to open a command window and type the following to get you into the MySQL command line where you can start writing your own queries.
mysql -uroot
I'm not terribly up on Microsoft SQL Server's flavour of SQL but I think that if you are used to using it then you might find it difficult to "get into" MySQL.
Here's a simple tutorial that gives an overview of MySQL and creating queries.
http://www.bigsoft.co.uk/blog/index.php/2012/10/04/sql-for-beginners
Check in Task Manager that mysql server is started.
Check if you can connect to the server, run telnet <hostname> <portnumber>, e.g.:
telnet localhost 3306
If you could not connect, try to find server properties (check port number), also check your firewall.
Look for the file my.ini and add bind-address = 0.0.0.0 in the [mysqld] stanza.
Well, I don't exactly know what caused this issue in the first place, but I was able to find a way to solve it. A helpful, if old - perfect in this case - tutorial I found on the web, that hopefully can help others with the same problem.
Tutorial: Install MySQL 4.0 - Windows, by Dr. Thomas E. Hicks
Computer Science Department
Trinity University
Link Here
I'm not sure if the services application is on other windows or not but if you use Windows 7, you are lucky. The easiest method is to open Start panel,in the search box,type services and hit enter.Now scroll down till you find the mysql service.In the latest version, it is named MySQL57. Right click on it and click on start.
Now you are good to use MySQL. However,you will have to perform this step every time the windows starts.
Open the MySQL Installer and click on where it says "reconfigure" next to "MySQL Server"
if it is showing error 2003 (HY000): Can't connect to MySQL server on localhost (10061) than
1.search services.msc in run
2.goto mysql properties
3.copy the mysql service name
4.start cmd as administrator
5.write: net start mysqlservicename .i.e mysql57 or etc
it will show mysql is starting.
Is it necessary that the computer at which a c#.net program is to be run should be connected to the developing machine to deploy that program as this program uses oracle database to save user's data items
if yes : then plz explain minimum footprint to install oracle database at each target machine
if no : then how could the target will create and access the oracle database through these 5-7 dll files.
any response will be highly appreciable as I am very uncomfortable being in this confusioin. Thanx all....
I think you're mixing two different things. Application deployment vs. IT Requirements. For your app deployment NO, you don't need to be connected with your clients, use instead something like ClickOnce. Now, for your IT Requirements, well, if your client needs to have Oracle then they need to provide the DB.
Are they willing to pay each for a license? If not, why don't you use a Cloud DB Service? Or something light like Oracle Express (which is, free).
I like to use an database for my program, and I ran into SQLite.
At my first look, SQLite looks great. But there's only one thing.
I don't want that users must install SQLite in order to run the program.
Now did I see that I can download the source code of it.
So my question to you guys is... Can I compile the SQLite server into my program, and then use the server like normal? And when you stop the program, the server stops also??? Is this possible?
Thanks in advance
SQLite doesn't use a server, it's just a DLL reference and a shared file format. It is the best choice for what you are trying to do.
Check this library out: http://system.data.sqlite.org/index.html/doc/trunk/www/index.wiki , http://sqlite.phxsoftware.com/
There is no such concept like SqLite server.
For deploying SqLite, to client machine for you it's enough to deploy C# drivers to be able to connect to that DB (you can download them from here), and DB file itself (in case when you don't create it at runtime).
In other words, there is nothing to install, there is no any service to start.
What you are looking for is an "Embedded Database".
SQL Server Express can be embedded, so that your users don't need to install the server. They will just need the data file.
I'm hoping someone can help me. I recently started the development of a windows form application connecting to a remote sql server database. I was happy enough developing it until a potential client queried if they would be able to buy the whole application but they do not want the application connecting to the db via the internet.
I predominantly develop websites using php/mysql but migrated to c# for this particular project. I'm familiar with sql but not sure what database I should be using if the client wishes to have the whole application on their own computer. I've considered providing the database install as a pre-requisite when publishing the app (although I'm currently not sure how to do that) but I'm having reservations whether that is suitable or could lead to more problems. I want to create an application that can install to a single computer and has little to no need for administration. Could someone advise the best way to approach the data storage in this instance.
Because you have already a SqlServer database operating on your remote site, the best path should be to use the LocalDB version of SqlServer Express 2012. See this link about deployment.
If you don't use stored procedures, views and triggers then also the SQL CE could be an option, but you will not have file binary compatibility and you should work on importing your schema and data.
SQL CE is a compact light weight way of going..
http://blogs.msdn.com/b/sqlservercompact/archive/2011/01/12/microsoft-sql-server-compact-4-0-is-available-for-download.aspx