I have developed a c sharp application that connects to a MySQL database for a uni assignment. When I submit it to be marked is it going to work on another computer? or do I need to include something to get it working on theirs?
Thanks
Michael
Is the MySQL db located somewhere accessible from any public address? If so, then you only need to make sure your code points to the db's public IP instead of the local ip. If the db is not public, you will need to make sure the person running your code can get through the router, firewalls, and to your ip from wherever they are connecting.
If you want to make your application to use online database, upload your database on any free web hosting server.
I personally use 000webhost.com. But there are many. You can use any server.
You only need to change one thing. The connection to an ip will be provided by your server instead of localhost.
Related
I've just installed MySQL with phpmyadmin on my VPS via ssh protocol, and I've created root account with all privileges. I figured out how to connect with my databases via C# using MySQL 5.5v. for .Net 2.0 - the only version acceptable for Unity3D. And I have a few questions about it. I don't know is it right to connect to database on client side with root account, i mean something like that: Server=***;Database=Users;Uid=root;Pwd=***;
and then type query: SELECT * FROM Users where .... i think its unsafe way. How can I connect do it in more safety way? Without giving Password to Root account in C# code, maybe create another account without modify permissions?
It's not a good idea to connect to the database from the client(Unity), if this app will be released anywhere on the internet. The way to do this to use POST or GET method with the help of the WWW class, to send and receive information your server.
Your server should be coded with php,perl, c++ or whatever language you prefer.It will read data you send from Unity, then retrieve information from database and send it back to the client(Unity). Again, the whole database connection should be done on the server not on the client side.
One exception to this is when your app will only be used in your company office. As long as it will be made available for others to download, it is not secure if you hard-code the login information or even allow direct connect to the database from the client side. There are many examples on Unity wiki website.
I've been searching about this on Google and I did find some useful stuff but I'm not totally sure if that's what I need so I'll ask here.
I'm trying to make a Windows Store application and I want to connect to a simple MySQL database that's on the server. What's the easiest or best way to do that? Whenever I need local databases I use Entity Framework. Is it possible to use it here and if so, are there any tutorials that cover everything that I need to install as well as some code examples?
My advice for you : read more about Database Engine :) cause once you connect you DB Engine to a Database : either it is local or on remote machine (Server) its the same thing when you look at it from your application.
1- First watch this read more about this : SQL Server Management Studio
2- watch this (how you connect to a remote database) enter link description here
3- Very important is to allow connection from Remote Machine enter link description here
4- Once you are able to connect to the remote database from your SQL Server, everythg is the same on EF.
First of all, I took a look to every related topic on her about this issue. However non of them was successful in answering my question fully.
Curently I am working on a desktop app, coded in C#, that requires mysql connection both for authentication and storing user custom lists etc.
I put my test database in my account on hostgator and I connected to it with a connection string that looks like;
public static string cs = "Server=xx.xx.xxx.xx;Port=3306;Database=xxx;Uid=xx;Password=xxx";
Even though everything was 100% correct, the connection wasn't possible until I whitelisted my own ip address.
Now everything is working perfect for me, however the thing is that how am I supposed to whitelist all the users of my desktop app for them to be able to connect to the db.
Is there anything that I can do to allow the connection without having to whitelist everyone?
Thank you in advance
Alex
Yes, that'll probably an MySQL (or perhaps even a firewall) configuration option. I guess though that the hoster doesn't allow everyone to connect to a hosted MySQL service, because of the obvious security concerns.
You'd better write a simple service that runs on the webserver, which will publish the data you wish to share. You can then consume this service in your C# app.
I'm not sure if this is the right place for this question, but here goes......I have a website that was developed in PHP using MYSQL. Now, I am wanting to write an application in Visual C# which accesses the MYSQL database, and returns data from that database to the application. I attempted this, and received the error "(xx.xxx.xxx.xx) is not allowed to connect to this MYSQL server". After some research, I found that there was a way to turn this off on the server by IP address. However, this application would eventually be distributed to other people and PC's, so I don't think this is a permanent solution. I think I could open the MYSQL database to the world, but I'm hoping for some way that I can connect to MYSQL and tell the server that I am coming from the hello world application only. Does anyone know if this is possible from Visual C# and MYSQL, or know of a secure way to connect to a remote website MYSQL database using an application that can have a dynamic IP address?
Thanks in advance!
Ramhound is right in that you need to reconfigure your server if you want to do anything like this, but if you want to connect to the server directly from the client applications, your client would need to have the password for your Mysql which is not ideal..
Instead you should set up a webservice on your database server, and use that to sent/receive data to and from the clients.
Its complicated.
I have SQL Server 2008 on my production server and the access to that is restricted using IP. As I don't have a static IP, I cannot connect to server from my machine. The only option is going remote on production server and working there, but for obvious reasons I don't like it.
So the only solution I can think of is using a SQL Admin Panel on which I only need to manipulate the table data. The only implementation of this method I saw is one from code project. ( Link here ). Its very outdated and most of the coding is done in classic asp.net style. I do not want to use it.
My questions are
Is there a good implementation of SQL Admin Panel in ASP.NET?
Have I got any other alternatives on manipulating my IP restricted remote database?
P.S: And yes, I know that maintaining a SQL Admin Panel on a live server is not good at all. I will be removing my SQL Admin Panel from my website as soon as the site goes live :)
As far as question 2 is concerned, I have done work on databases sql server 2008 on the host without having a static ip. My hosting provider put my IP on a safe list which accepted my connection until my IP reset. It's a pain but does stay the same for a long time. You can find yours at http://www.whatismyip.com/
Not sure if your host will allow the same.