Establishing a database connection using Putty to tunnel over SSH

I currently have an ASP.NET web application that is using a MySQL database as the source data. I would like to connect to this database using the standard MySQL listening port of 3306 and tunnel the database connection over SSH (Port 22). I have Putty on my Web server and will configure Putty to do Port Redirection (3306 > 22 > 3306). I would like my web application to first open the Putty connection (somehow have my web application pass the credentials to the server via Putty) which would establish an SSH connection to the distant server. Once that SSH connection is established, I would then establish a standard MySQL database connection using a connection string. I would prefer not to leave the SSH connection open all the time and want Logi to handle both the SSH and database connection calls only when it is needed. This methodology of tunneling a database connection over SSH is not MySQL specific and could be used to securely tunnel any database connection. Has anyone done anything like this and if so could you provide me with how you had the web application establish these connection calls

Posted On: Tuesday 20th of November 2012 04:29:56 AM Total Views:  414
View Complete with Replies

Related Messages:

establishing an oracle connection in   (206 Views)
dear all; I have the following code which i am trying to use to connect to my sql plus and i keep getting the error message connection string is not well-formed. see my code below protectedvoidButton1_Click(objectsender,EventArgse) { stringoradb="UserId=finance;Password=finacecc;DataSource=XE"; stringsql="selectID,Create_datefromt_mobile"; OracleDataAdapteradapter=newOracleDataAdapter(oradb,sql); OracleCommandBuilderbuilder=newOracleCommandBuilder(adapter); DataSetdataset=newDataSet(); adapter.Fill(dataset,"t_mobile"); DataTablemytable=dataset.Tables["t_mobile"]; GridView1.DataSource=mytable; GridView1.DataBind(); }
Import xls file into sql server database table in   (124 Views)
I have one xls file which has 1.98 lacs rows. Whenever I try to import it in sql database table then I am getting following error to open OLE db connection. External table is not in the expected format. My code: stringcon="Provider=Microsoft.ACE.OLEDB.12.0;DataSource="+Server.MapPath("TowerWorkOrders20110316.xls")+";ExtendedProperties=\"Excel12.0\""; //stringcon="Provider=Microsoft.Jet.OLEDB.4.0;DataSource="+Server.MapPath("TowerWorkOrders20110317.xls")+";ExtendedProperties=Excel8.0"; OleDbConnectionconnection=new OleDbConnection(con); OleDbDataReaderreader; connection.Open(); OleDbCommandcommand=newOleDbCommand("SELECT*FROM[Sheet1$]",connection); reader=command.ExecuteReader();.................
How database process multiple request at the same time.   (131 Views)
I have a doubt. For examples, Multiple users trying to update the same record usign application. Can any one explain me indatil the situation how db process the request.
About using text file as database to store data   (203 Views)
l was requested by someone to help with doing a website using text file to store data and display it using html codings. The requested website must be able to do the following functions: 1) Browse for template using txt file and select the txt file as template. (Font-styles, headers, tables....etc) 2) Browse for txt file that stores the data and display them in a so called table format categorized properly. 3) Able to do a search function and store the search results in a new txt file. (Which means a new txt file is created everytime someone performs a search and the search results is stored in the new created txt file) Is there any website with informations/tutorials on these
How to save rich text into the database from word file ?   (293 Views)
, I am reading a word file and saving the contents into the database and retrieving it. One issue is that if word document contains a bold text or underlined text it is not getting saved into the same format. Is there any possible way to save and retrieve the rich text.
problem connecting to mysql database   (218 Views)
I'm new to and I'm trying to connect to a mysql database but I'm getting this error when I'm running my application. Access denied for user 'test_mysql'@'localhost' (using password: YES). I used thistutorial to get this far ( ) but I don't know how to fix this.
Save file into database through controls   (150 Views)
I want to save a file (e.g. .xls, .pdf, .doc)into MySql database through web interface, and then to download this file. i have fields WONO,PONO,Des on my webform i am supposed to have another filed upload excel file from should save as usaul like rest of the fields into databases and retreive same on to web form when required and open the same excel sheet.I really
database   (102 Views)
hai, i am working with sql server. i loaded private assemblies into bin. it showing exception while coming to database referece as showed below. Could not load file or assembly 'MySql.Data, Version=, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified. quick help please.
Problem in connecting to oracle database,which is using Provider=MSDAORA.1   (175 Views)
Hi I am Naveen, I am upgrading a internal website from .Net 1.1 to .Net2.0 in Vb. The database is deployed in the server, but i could not connect to that database. i have to connect database to few drop down lists, my manager has given connection string to me... i have placed it in web.config and given that link properly in the code.. but the database is not connecting.. the list is showing empty.. my conn string is can anyone help me,,,
How to place a MYSQL database in my ASP.NET site App_Data folder?   (108 Views)
Hi! How to place a MYSQL database in my ASP.NET site In what format I produces the file to myAPP_DATA database folder to place it. How to build CONNECTION STRING to database located in APP_DATA I created a site conncted with a LOCALHOST database. Now I want to import it into my website folder APP_DATA Please help.
Need help with uploading a text file in to mysql database   (368 Views)
I want to upload a text file and stored to my database. the column on mydatabaseit is longblob type. I don't know much about this so if anyone can help I will
Error coming in insert the date from asp net.2.0 to oracle database   (256 Views)
Sir, As per our knowledge i use the code in asp .net 2.0 with c#, but in this code i got the error. So that way i need your help for solve the error, and my code. MY CODE IS:-- protected void Btn_submit_Click(object sender, EventArgs e) { int year = Int32.Parse(DDLYear.SelectedValue); int month = Int32.Parse(DDLMonth.SelectedValue); int day = Int32.Parse(DDLDay.SelectedValue); DateTime date = new DateTime(day, month, year); string dt = Convert.ToDateTime(date).ToString("dd-MMM-yyyy"); string connectionString = WebConfigurationManager.ConnectionStrings["inside1"].ConnectionString; OracleConnection con = new OracleConnection(connectionString); OracleCommand cmd = new OracleCommand("INSERT INTO ADMIN_FORM(FULL_NAME, USER_NAME, PASSWORD, E_MAIL, DATE_OF_BIRTH, GENDER, COUNTRY) VALUES (:FULL_NAME, :USER_NAME, :PASSWORD, :E_MAIL, :DATE_OF_BIRTH, :GENDER, :COUNTRY)",con); cmd.Parameters.AddWithValue(":FULL_NAME",TXTBX1.Text); cmd.Parameters.AddWithValue(":USER_NAME",TXTBX2.Text); cmd.Parameters.AddWithValue(":PASSWORD",TXTBX3.Text); cmd.Parameters.AddWithValue(":E_MAIL",TXTBX5.Text); cmd.Parameters.AddWithValue(":DATE_OF_BIRTH", dt.ToString()); cmd.Parameters.AddWithValue(":GENDER",RadioButtonList1.SelectedValue.ToString()); cmd.Parameters.AddWithValue(":COUNTRY",DDLCountry.SelectedItem.ToString()); try { ---------------------- ---------------------- } MY PROBLEM IS:-- I use the oracle databasae and in which I want to enter the date-of-birth from dropdownlist over the default.aspx page. In the Oracle database "DATE_OF_BIRTH Date;" On the time of run my pages this error has comeout Error: Year, Month, and Day parameters describe an un-representable DateTime. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentOutOfRangeException: Year, Month, and Day parameters describe an un-representable DateTime. Please help me for solve this error:
Increase the database size...   (139 Views)
Hi , Can anybody tell me how can I increase the size of the database in oracle manually. Is it possible
Problem in the connection between MySQL database and ASP.NET   (161 Views)
connection stiring in webconfig like this when we create connection need to MySql Provider. MySqlDataAdapter mySqlAdap = new MySqlDataAdapter("select date_format(HDate,'%Y-%m-%d') as Date,Occassion from tblholidays order by HDate", clsConnection.MySqlConn); DataSet ds = new DataSet(); mySqlAdap.Fill(ds); tye this. It will helps you. working copy fully tested.
Performance tuning and oracle database before it is connected to a .Net app   (162 Views)
I have been given a .Net app connected to quite a large oracle database, and I have been given the task of optimising / tuning the database, i.e adding indexes partitions etcthat will enhance performance.. The system has not been rolled out yet, so I am unaware of any bottle knecks or areas where performance needs enhancing, my job is to predict and alter the database as a precursor to it being rolled out.. To do this does anyone have anythaughts about the following process: 1. Predicthow the system will beused and write up a list of scenarios, eg reports on x, y, and z, searching of x, y z.. 2. Run the sql for the proposed scenarios to observe quiery times 3. Add indexes / Re-format SQL statements / partitions to optimise the performance ========================================================================================= Does anyone have any idea of better strategies Also, in terms of re-writing SQL statements, I believe there are tools around that will auto generate alternatove optimised SQL ststements from the one given, does anyone know of any of these
Using database MySQL instead of MS SQL   (132 Views)
Hi friendz, i am using VS 2008 and in my site i choose MySQL as my database whereas for membership provider it is default SQL Server. is this ok and can u tell me Mysql is better or MS SQL is better as i have seen webhosting sites that cant give extra space for MSSQL server but they give the MySQL unlimited space.. also my second problem is i want to store some formatted text in my Mysql databse like email format, nd other website policies so can u tell me the better and esiast way to approach this help plz.
Load data from an EXCEL 2007 file to SQL Server 2008 database   (134 Views)
Hi all member, I want to load the data from an EXCEL 2007 file to SQL Server 2008 database. I am geting following error. The Microsoft Office Access database engine could not find the object 'Sheet1$'. Make sure the object exists and that you spell its name and the path name correctly. Following is the complete source code.Kindly any senior member guide me what is the problem in the following code. Imports System.Data.OleDb Imports System.Data.SqlClient Imports System.Data.Common Imports System.Data Partial Public Class ImportDataInherits System.Web.UI.PageProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click 'Declare Variables - Edit these based on your particular situation Dim sSQLTable As String = "ExcelFileLoad" Dim sExcelFileName As String = "ExcelLoadSQL.xlsx" Dim sSheet As String = "[Sheet1$]" 'Create our connection strings Dim sExcelConnectionString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Server.MapPath(sExcelFileName) & ";Extended Properties=""Excel 12.0;HDR=YES;""" 'Series of commands to bulk copy data from the excel file into our SQL table Dim OleDbConn As OleDbConnection = New OleDbConnection(sExcelConnectionString) Dim OleDbCmd As OleDbCommand = New OleDbCommand(("SELECT * FROM " & sSheet), OleDbConn) Dim sSqlConnectionString As String = "Data Source=JED5244R; Initial Catalog=testfresh; UID=sa; PWD=xyz" OleDbConn.Open() Dim dr As OleDbDataReader = OleDbCmd.ExecuteReader() Dim bulkCopy As SqlBulkCopy = New SqlBulkCopy(sSqlConnectionString) bulkCopy.DestinationTableName = sSQLTable bulkCopy.WriteToServer(dr) OleDbConn.Close() End Sub End Sub Class I will be
How to synchronize data of different oracle database ?   (264 Views)
Hi all I am using oracle database, Database db1 Table: tlbdb1_City1 Database db2 Table: Tlbdb2_City2 I want to synchronize data of tlbdb1_City1 to Tlbdb2_City2 How it is possible, change of tlbdb1_City1 is automatically update at Tlbdb2_City2
Saving textbox data to MySql database in   (165 Views)
Hi dear coders though a very simple question to ask, but please tell me how to save and retrieve data in/from my textboxes to/from database (MYSQL) on submit button click. i know its a very simple task but i cant make it done, so i request you to please send me some working example link or post any helpful code here in i will be highly
Lookup defined default value for columns from database schema   (166 Views)
For manycolumns in our database we have defined default values, and we would like to lookup those default values to display them in textboxes etc. in DetailsViews in insert mode. The DataTableReader.GetSchemaTable method should return a datatable with, among other things, a column named 'DefaultValue' (see I've tried that, but the value reported for DefaultValue is always System.DBNull, even if I know for sure that I should get a "real" default value as defined in the database (like 0 or sometimes 99 for numeric fields). Any ideas how to solve this Some of my VB.NET source code: PublicFunctionGetColumnDefaultValue(ByValp_sTableAsString,ByValp_sColumnAsString) Trace.WriteLine("wsDataProvider.GetColumnDefaultValue:"&p_sTable&"."&p_sColumn) Diml_vDefaultAsObject=Nothing,l_bErrorAsBoolean=False If(IsColumn(p_sTable,p_sColumn))Then Diml_sSqlAsString If(UsesAccessDB())Then l_sSql="selecttop1`"&p_sColumn&"`from`"&p_sTable&"`" Else l_sSql="select`"&p_sColumn&"`from`"&p_sTable&"`limit1" EndIf Try Diml_oDataSetAsDataSet=FillDataSet(l_sSql,"DataColumns") Diml_oDataTableReaderAsDataTableReader=l_oDataSet.CreateDataReader(l_oDataSet.Tables(0)) Diml_oSchemaAsDataTable=l_oDataTableReader.GetSchemaTable() l_vDefault=l_oSchema.Rows(0)("DefaultValue") CatchexAsException System.Diagnostics.Debug.WriteLine("wsDataProvider.GetColumnDefaultValue:"&ex.Message) ' l_bError=True _oErrorHandler.LogError() EndTry EndIf Ifl_bError=TrueThen _oErrorHandler.DisplayErrorPage() EndIf Returnl_vDefault EndFunction