Change mysql port?

uberamd

Member
Joined
Jan 22, 2007
Messages
9
Programming Experience
Beginner
VB.NET:
conn = New MySqlConnection() 'Instanciates the mysql object
        conn.ConnectionString = "server=mywebsite.com;" _
        & "user id=root;" _
        & "password=test;" _
        & "database=db"
        Try
            conn.Open()
            MessageBox.Show("Connection Opened Successfully")
            frmBody()
        Catch myerror As MySqlException
            MessageBox.Show("Error Connecting to Database: " & myerror.Message)
        Finally
            conn.Close()
        End Try
That is my code, I can connect to the mysql server using MySQL Administrator but the application just says it cannot connect to any database hosts. However, my MySQL port on the server is not the default 3306, it is 44473. SO, how do I change the port that VisualBasic uses to connect so that it can successfully connect to the server? I assume this is why it will not connect, im guessing its using the default port, which I want to change.

Thanks.
 
i'd guess something like:

server=mysite.com:44473;


but you would be better looking in the mysql docs - this conenction string code has NOTHING to do with vb - all vb does is pass it to the mysql driver, which decodes it. Hence., you need the mysql docs. Try posting in the mysql forum here, or a mysql forum
 
Back
Top