Lost Password?


  #1 (permalink)  
Old 08-30-2006, 09:24 PM
dirkfirst dirkfirst is offline
Programming Professional
 
Join Date: May 2006
Posts: 338
Rep Power: 12
dirkfirst is on a distinguished road
Default Connecting to MySQL without DSN

Is there a way to connect to MySQL without a DSN in the system?
__________________
DirkFirst
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 08-31-2006, 11:38 AM
brackett brackett is offline
Programmer
 
Join Date: May 2006
Posts: 193
Rep Power: 11
brackett is on a distinguished road
Default

Depends on what provider your using. OleDb would be something like:
Code:
"Provider=MySQLProv;Data Source=mydb;User Id=UserName;Password=asdasd"
Check ConnectionStrings.com for other variations.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-31-2006, 08:37 PM
dirkfirst dirkfirst is offline
Programming Professional
 
Join Date: May 2006
Posts: 338
Rep Power: 12
dirkfirst is on a distinguished road
Default

I found a free library that allowed me to connect o mysql without DNS entries.
__________________
DirkFirst
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-01-2006, 12:18 PM
Saint Saint is offline
Learning Programmer
 
Join Date: Aug 2006
Posts: 63
Rep Power: 9
Saint is on a distinguished road
Default

I found this which is in C# but you port it to managed C++


You need to download and install this:
http://dev.mysql.com/downloads/connector/net/1.0.html

Code:
			string MyConString = "SERVER=localhost;" +
				"DATABASE=mydatabase;" +
				"UID=testuser;" +
				"PASSWORD=testpassword;";
			MySqlConnection connection = new MySqlConnection(MyConString);
			MySqlCommand command = connection.CreateCommand();
			MySqlDataReader Reader;
			command.CommandText = "select * from mycustomers";
			connection.Open();
			Reader = command.ExecuteReader();
			while (Reader.Read())
			{
				string thisrow = "";
				for (int i= 0;i<Reader.FieldCount;i++)
						thisrow+=Reader.GetValue(i).ToString() + ",";
				listBox1.Items.Add(thisrow);
			}
			connection.Close();
Taken from http://bitdaddys.com/MySQL-ConnectorNet.html
__________________
Hi >> Saint
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 09-02-2006, 12:37 PM
Void's Avatar   
Void Void is offline
Programming Expert
 
Join Date: Jun 2006
Posts: 411
Rep Power: 12
Void is on a distinguished road
Default

Saint said it. I've used that driver before and it preforms very well.
__________________
Void
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 09-05-2006, 12:17 PM
Ronin Ronin is offline
Programming Professional
 
Join Date: Apr 2006
Posts: 299
Rep Power: 11
Ronin is on a distinguished road
Default

Is this a secure way to connect though? I mean, can't anyone that uses your client to connect be able to retrieve your username and password? You had better think on that before releasing this software to the public. You may end up with an empty DB.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 10-03-2006, 07:11 PM
dirkfirst dirkfirst is offline
Programming Professional
 
Join Date: May 2006
Posts: 338
Rep Power: 12
dirkfirst is on a distinguished road
Default

I'm not sure if it is very secure or not. It doesn't seem very secure.....
__________________
DirkFirst
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 10-04-2006, 05:14 AM
brackett brackett is offline
Programmer
 
Join Date: May 2006
Posts: 193
Rep Power: 11
brackett is on a distinguished road
Default

It's as secure as the client. In other words, if you've set up DB access correctly so that the login provided only has permissions to do certain things - then anyone with that login only has permissions to do the same things your app does.

In other words - no it's not secure. But it's not really supposed to be either. Security is enforced at the database in this situation.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 10-07-2006, 10:58 AM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 9,648
Last Blog:
PHP Objects, Patterns,...
Rep Power: 20
Jordan is just really niceJordan is just really niceJordan is just really niceJordan is just really nice
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

In other words dirkfirst, you should set grant permissions very limiting from the app connecting to your DB.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tutorial: PHP to MySQL Jordan PHP Tutorials 9 09-05-2008 01:12 PM
MYSQL CheatSheet - A must for MySQL Users reachpradeep Database & Database Programming 1 03-03-2007 04:05 PM
Toad for MySQL Lop Database & Database Programming 0 12-06-2006 12:07 PM
Toad for MySQL 2.0.1 Kernel Software Development Tools 0 10-03-2006 07:03 AM
MySQL Resources dirkfirst Database & Database Programming 1 05-25-2006 03:31 AM


All times are GMT -5. The time now is 05:59 PM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 100%


Complete - Celebrate!

Ads