Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter jtrahair

    (@jtrahair)

    It is installed already. I have a new domain which I installed it on.

    Thread Starter jtrahair

    (@jtrahair)

    So, either I have to write a server-based program in another language, or the client-side VB.net program somehow sends the SQL query to the server and returns the data from the query. I prefer the second one but I’m not sure where to start!

    Thread Starter jtrahair

    (@jtrahair)

    This is a test procedure which looks up invoice 77 from the table of invoices which II wrote using VB.net. The error happens within the program on the line marked with <<<, ie. connMySQL.Open().

    (Assume that all other items are in place and that when my laptop’s IP address is registered with the MySQL database everything works just fine. Obviously, the connection string has been modified for you to see, and that the xxx etc. are replaced by valid and working settings. I never use qwerty as a password!)

    Dim strSQL As String = ""
            Dim connMySQL As New MySqlConnection
            Dim strResults As String = ""
    
            Try
    	    'Set connection string:
                connMySQL.ConnectionString = "server=160.xxx.xxx.xxx;Port=3306; user id=i1234_wp1; password=qwerty; database=i1234_wp1;"
    
                connMySQL.Open()  <<<< error happens here.
    
                'Look up a test record, say invoice number 77:
                Dim cmd As New MySqlCommand
                cmd.Connection = connMySQL
    
                strSQL = "SELECT * FROM Invoices WHERE InvoiceNumberInt = 77
                cmd.CommandText = strSQL
    
                Dim myData As MySqlDataReader
                myData = cmd.ExecuteReader
                If myData.HasRows = 0 Then
                    MsgBox("!")
                Else
                    While myData.Read
                        'Display some of the data from invoice 77:
                        strResults = strResults & myData.GetValue(0).GetType.ToString & " " & myData.GetName(0) & " " & myData.GetValue(0) & vbCrLf
                        strResults = strResults & myData.GetValue(1).GetType.ToString & " " & myData.GetName(1) & " " & myData.GetValue(1) & vbCrLf
                        'etc.
                        strResults = strResults & myData.FieldCount & vbCrLf
                        strResults = strResults & vbCrLf
                    End While
                End If
                myData.Close()
                cmd.Connection.Close()
    
                MsgBox(strResults)
    
            Catch ex As Exception
                MsgBox(ex.Message, vbExclamation, mCompanyName)
            End Try
    Thread Starter jtrahair

    (@jtrahair)

    Except that, as an experiment, I deleted my computer’s IP address from cPanel Remote MySQL, and the connection failed, error message:
    “Authentication to host ‘160.xxx.xxx.xxx’ for user ‘i1234_wp1’ using method ‘mysql_native_password’ failed with message: Access denied for user ‘i1234_wp1’@’178.zzz.zzz.zzz’ (using password: YES)”

    On restoring the IP address in Remote MySQL the connection succeeded.

    Thread Starter jtrahair

    (@jtrahair)

    So, are we saying that the WordPress database doesn’t mind what IP address wants to connect to it, so my Monday morning scenario won’t happen? (See above.)

    Thread Starter jtrahair

    (@jtrahair)

    Thank you. I will abandon ‘my’ database and add the new tables, fields and records to ‘i1234_wp1.

    Thread Starter jtrahair

    (@jtrahair)

    Thanks, tsure. The MySQL/phpMyAdmin page shows 2 databases – the one I created and a WordPress database eg. i12345_wp1. Both are described as localhost in phpMyAdmin.
    The customer will HTTP the server – how would it pass the SQL string and how will it pass back the data returned?
    Thanks again.

    Thread Starter jtrahair

    (@jtrahair)

    MySQL on-line will only accept connections from IP addresses previously granted. Yes, granting individual access to certain IP addresses is possible. But some users IP addresses aren’t fixed they’re dynamic, meaning they change frequently. I don’t want to be the person my customers ring on Monday mornings when they can’t connect to their own on-line database (‘It’s happened again – fix it!’).
    I was told that to overcome this problem I should put a WordPress site between my customers computers and the MySQL database. The WordPress site’s IP address won’t change, and customers can connect to the WordPress site and send SQL strings to MySQL and receive back the data.
    My question is, how do I use WordPress as the go-between?
    Thanks for your reply, hope this makes sense!

    Thread Starter jtrahair

    (@jtrahair)

    WordPress is on a new domain set up and hosted by godaddy.

Viewing 9 replies - 1 through 9 (of 9 total)