This MySQL client implements a limited subset of the MySQL internal client/server protocol (including authentication), for server versions 4.1 and newer.
This example inserts a record into a table named 'Test' containing one text column named 'Test'.
Configure the parameters at the top of the example accordingly to your setup.
Any examples on retrieving rows on a SELECT statement? I've worked with MySQL before and would use:
while(MySQL.FetchNext())
{
ulPermissions = MySQL.Field("AUTH").asLong();
}
Error 2 during connection and Error 3 during SQL Command.
I don't know why and what does this mean? I use MySQL Server 5.1
I got everytime 2 failures...
Error 2 during connection and Error 3 during SQL Command.
I don't know why and what does this mean? I use MySQL Server 5.1
In this line what is meant by IpAddr() ?
I have to give the Ip address of the host? Or just keep that line unchanged?
Important:
Host host(IpAddr(), 3306, SQL_SERVER);
In this line what is meant by IpAddr() ?
I have to give the Ip address of the host? Or just keep that line unchanged?
After converting the Code to C I found some problems in the Send Auth:
if( m_len - (m_pPos - m_buf) != 44)
{
//We only support protocol >= mysql-4.1
DBG("Message after pcsz has wrong len (%d != 44)...\n", m_len - (m_pPos - m_buf));
onResult(MYSQL_PRTCL);
return;
}
Should be changed to:
uint16_t serverFlags = *((uint16_t*)&m_pPos[13]);
if( ! (serverFlags & (CLIENT_RESERVED | CLIENT_PROTOCOL_41 | CLIENT_SECURE_CONNECTION )) ) // New 4.1 protocol
{
//We only support protocol >= mysql-4.1
DEBUGF(LOG,("We only support protocol >= mysql-4.1\n"));
onResult(MYSQL_PRTCL);
return;
}
A server might send server capabilities of : 0xf7ff and not 0x2c82 as expected in the code.
Regards,
Nick
Hi,
After converting the Code to C I found some problems in the Send Auth:
<<code>>
if( m_len - (m_pPos - m_buf) != 44)
{
//We only support protocol >= mysql-4.1
DBG("Message after pcsz has wrong len (%d != 44)...\n", m_len - (m_pPos - m_buf));
onResult(MYSQL_PRTCL);
return;
}
<</code>>
Should be changed to:
<<code>>
uint16_t serverFlags = *((uint16_t*)&m_pPos[13]);
if( ! (serverFlags & (CLIENT_RESERVED | CLIENT_PROTOCOL_41 | CLIENT_SECURE_CONNECTION )) ) // New 4.1 protocol
{
//We only support protocol >= mysql-4.1
DEBUGF(LOG,("We only support protocol >= mysql-4.1\n"));
onResult(MYSQL_PRTCL);
return;
}
<</code>>
A server might send server capabilities of : 0xf7ff and not 0x2c82 as expected in the code.
Regards,
Nick
I am hoping you may be able to help me. I cannot get past the error 2 when using this program no matter what server I try to connect to. (I have created the same table on several servers and keep getting an error 2). I created a LAMP server on a Raspeberry Pi and get an error 2 when also trying the above code. I have created and rechecked several times users to the mySQL database through the privileges section of phpmyadmin and still am encountering the error 2 code. Do you have any suggestions of where to look next?
Many thanks
Fergal.
Hi Guys,
I am hoping you may be able to help me. I cannot get past the error 2 when using this program no matter what server I try to connect to. (I have created the same table on several servers and keep getting an error 2). I created a LAMP server on a Raspeberry Pi and get an error 2 when also trying the above code. I have created and rechecked several times users to the mySQL database through the privileges section of phpmyadmin and still am encountering the error 2 code. Do you have any suggestions of where to look next?
Many thanks
Fergal.
I am hoping you may be able to help me. I cannot get past the error 2 when using this program no matter what server I try to connect to. (I have created the same table on several servers and keep getting an error 2). I created a LAMP server on a Raspeberry Pi and get an error 2 when also trying the above code. I have created and rechecked several times users to the mySQL database through the privileges section of phpmyadmin and still am encountering the error 2 code. Do you have any suggestions of where to look next?
Many thanks
Fergal.
I got the same error, can someone help please?
<<quote fohanlon>>
Hi Guys,
I am hoping you may be able to help me. I cannot get past the error 2 when using this program no matter what server I try to connect to. (I have created the same table on several servers and keep getting an error 2). I created a LAMP server on a Raspeberry Pi and get an error 2 when also trying the above code. I have created and rechecked several times users to the mySQL database through the privileges section of phpmyadmin and still am encountering the error 2 code. Do you have any suggestions of where to look next?
Many thanks
Fergal.
<</quote>>
I got the same error, can someone help please?
I am hoping you may be able to help me. I cannot get past the error 2 when using this program no matter what server I try to connect to. (I have created the same table on several servers and keep getting an error 2). I created a LAMP server on a Raspeberry Pi and get an error 2 when also trying the above code. I have created and rechecked several times users to the mySQL database through the privileges section of phpmyadmin and still am encountering the error 2 code. Do you have any suggestions of where to look next?
I am hoping you may be able to help me. I cannot get past the error 2 when using this program no matter what server I try to connect to. (I have created the same table on several servers and keep getting an error 2). I created a LAMP server on a Raspeberry Pi and get an error 2 when also trying the above code. I have created and rechecked several times users to the mySQL database through the privileges section of phpmyadmin and still am encountering the error 2 code. Do you have any suggestions of where to look next?
Many thanks
Fergal.
I got the same error, can someone help please?
Me too, got the same error.
It seems that this code doesn't work anymore.
<<quote Group5_mbed>>
<<quote fohanlon>>
Hi Guys,
I am hoping you may be able to help me. I cannot get past the error 2 when using this program no matter what server I try to connect to. (I have created the same table on several servers and keep getting an error 2). I created a LAMP server on a Raspeberry Pi and get an error 2 when also trying the above code. I have created and rechecked several times users to the mySQL database through the privileges section of phpmyadmin and still am encountering the error 2 code. Do you have any suggestions of where to look next?
Many thanks
Fergal.
<</quote>>
I got the same error, can someone help please?
<</quote>>
<<quote Group5_mbed>>
<<quote fohanlon>>
Hi Guys,
I am hoping you may be able to help me. I cannot get past the error 2 when using this program no matter what server I try to connect to. (I have created the same table on several servers and keep getting an error 2). I created a LAMP server on a Raspeberry Pi and get an error 2 when also trying the above code. I have created and rechecked several times users to the mySQL database through the privileges section of phpmyadmin and still am encountering the error 2 code. Do you have any suggestions of where to look next?
Many thanks
Fergal.
<</quote>>
I got the same error, can someone help please?
<</quote>>
Me too, got the same error.
It seems that this code doesn't work anymore.
Please login to post comments.