Jump to content
UBot Underground

Strange server connection problem?!?


Recommended Posts

Hey guys,

 

 

I am really hoping someone would have a answer on this one since its really holding up the launch of my first BIG project.

 

A bot of mine requires to first fetch the data from a mysql database on a dedi but for some reason it is not connecting.

I tested the bot on 2 other servers and my home work laptop and there it works.

 

What it makes even more stranger is that when i run navicat on the 'not connecting' VPS i DO get a succesfull connection...

 

The database info i entered in navicat is copied from the bot so thats not the problem.

 

Anyone encountered this before or have some tips? I don't want to migrate the whole shabam if its not needed but this is driving me nuts!

 

 

 

Best regards botters!

 

 

Walter

Link to post
Share on other sites

got this issue too sometime  behind hma proxys

even if i pipe 3306  to 443 or 80  it is the same.

best way here is to work with php serverside

Link to post
Share on other sites

Hi Blumi, thanks for the reply man.

 

 

'Glad' i am not the only one with the problem...

 

 

I could do that indeed to show and scrape the data but thats not a option since i have to update specific rows in the DB on the fly wich makes things too complicated and not to mention BIGGER.

 

Ill try to connect trough php now instead of the mysql commands trough ubot and/or plugins. Maybe that will do the trick hopefully.

Link to post
Share on other sites

UPDATE:

 

Ok so i did a simple check with this code and guess what, now the requested data was pulled from the server...

 

Not sure why but now i can continue my work.

 

set(#TEST$plugin function("PHPUbotAddons.dll""Execute From Code""$con=mysqli_connect(\"xxx.xx.xx.xxx\",\"xxx_name\",\"pass\",\"xxx_DB\");
 // Check connection
 if (mysqli_connect_errno())
   \{
   echo \"Failed to connect to MySQL: \" . mysqli_connect_error();
   \}

 $result = mysqli_query($con,\"SELECT * FROM xxxDB\");

 while($row = mysqli_fetch_array($result))
   \{
   echo $row[\'specificrow\'];
      \}

 mysqli_close($con);""C:\\Program Files\\PHP\\v5.4\\php.exe"), "Global")
load html(#TEST)

 

Thanks Blumi for noticing the php option duh... :)

Link to post
Share on other sites

UPDATE:

 

Ok so i did a simple check with this code and guess what, now the requested data was pulled from the server...

 

Not sure why but now i can continue my work.

 

set(#TEST$plugin function("PHPUbotAddons.dll""Execute From Code""$con=mysqli_connect(\"xxx.xx.xx.xxx\",\"xxx_name\",\"pass\",\"xxx_DB\");

 // Check connection

 if (mysqli_connect_errno())

   \{

   echo \"Failed to connect to MySQL: \" . mysqli_connect_error();

   \}

 

 $result = mysqli_query($con,\"SELECT * FROM xxxDB\");

 

 while($row = mysqli_fetch_array($result))

   \{

   echo $row[\'specificrow\'];

      \}

 

 mysqli_close($con);""C:\\Program Files\\PHP\\v5.4\\php.exe"), "Global")

load html(#TEST)

 

Thanks Blumi for noticing the php option duh... :)

 

Maybe I'm wrong, but I think Blumi was talking about having a PHP script on your server which handles the database connection.

And then communicate with that PHP script from your bot. 

 

If you use PHP locally, all your customers have to install PHP on their system. Or you include it in your installer if that's an option.

Dan

Link to post
Share on other sites

Hi Dan,

 

 

Yeah true but i understood wat Blumi was saying only it was too complicated to do since i need data once at a time from multiple rows/columns AND able to update them when needed.

 

Its not for a bot that is going to be sold but mere for a service of mine.

 

Just meant that Blumi mentioned PHP and for some reason i never thought of it to try to establish a connection trough php but rather was thinking more on the road of firewalls/permissions etc etc...

Link to post
Share on other sites

dan 

what i was trying to tell  was  that if u use hma vpn  it could happend that your ubotscript not connect to your database

because all except http/s is blocked....
i was getting this issue many times even i try german vpn  servers

 

this stupid germans  :) :)

Link to post
Share on other sites

its not a smart move to pull data straight from the MYSQL database , i'd say you need to create an API interface , easier/faster way to get your data without some ennoying errors!

then you can use either the browser or a http call to pull the data out , output could be either xml or JSON !

 

Regards

Link to post
Share on other sites
  • 2 years later...

its not a smart move to pull data straight from the MYSQL database , i'd say you need to create an API interface , easier/faster way to get your data without some ennoying errors!

then you can use either the browser or a http call to pull the data out , output could be either xml or JSON !

 

Regards

Hi Aymen,

I know this post was a while ago, but can you point me in the right direction to create an API, as currently I pull my data from varies MySql queries straight from you bot.

Thanks

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...