Jump to content

Question

Posted

i dont know if this is the correct section if it isnt sorry,i posted here because i saw some php guides  in this section... anyways

i have a database in a dedicated server and i want to connect to the dedicated server's database from the web servers computer 

i know how to script a db connection(local) but i dont know how to connect the db of another computer can u please help me? 

9 answers to this question

Recommended Posts

  • 0
Posted

If you know to create a db scrip then, you have to be sure your computer with database have port 3306 allowed in firewall for outside connection then in your  db conection script you have to enter ip of computer user / pass...

  • 0
Posted (edited)

so i  tried to connect  and it was giving me instantly a error that cant connect to the mysql server then i opened the port  and it is trying to connect and after a minute error message tells that cant connect

Warning: mysql_connect(): Can't connect to MySQL server on '78.87.60.73' (4) in /home/l2gold/public_html/test.php on line 7
Failed to connect

this is the php code 

<?php
// Create connection
$con=mysqli_connect("78.87.60.73","root","","l2jesios");


if(!$con)
{
echo "Failed to connect";
}
else
{
echo "Connected";
}
?>

i disabled FireWall and now it gives this msg

Warning: mysql_connect(): Host 'ns5001871.ip-192-99-16.net' is not allowed to connect to this MySQL server in /home/l2/public_html/test.php on line 7
Failed to connect

i opened the port 3306 on 192.168.1.9

Edited by Nitzamc
  • 0
Posted

You need to give privilieges to your host, then it will be able to connect.

 

GRANT ALL PRIVILEGES ON *.* TO mysql@'ns5001871.ip-192-99-16.net';

 

Execute this query and then try connecting using your same host. 

 

  • 0
Posted (edited)

gived privileges and now it gives another message 


Warning: mysqli_connect(): (28000/1045): Access denied for user 'web@192.99.16.76'@'ns5001871.ip-192-99-16.net' (using password: YES) in /home/l2/public_html/test.php on line 7
Failed to connect to MySQL: Access denied for user 'web@192.99.16.76'@'ns5001871.ip-192-99-16.net' (using password: YES)


Edited by Nitzamc
  • 0
Posted

 

gived privileges and now it gives another message 


Warning: mysqli_connect(): (28000/1045): Access denied for user 'web@192.99.16.76'@'ns5001871.ip-192-99-16.net' (using password: YES) in /home/l2gold/public_html/test.php on line 7
Failed to connect to MySQL: Access denied for user 'web@192.99.16.76'@'ns5001871.ip-192-99-16.net' (using password: YES)


Thats mean you have added wrong password

  • 0
Posted

i WILL MAKE A TUTORIAL FOR THIS & no one will get error! i understand everything because i was trying to make a db connection from another server like 4 hours and finally i did!!!!!!

i had wrong username xD

  • 0
Posted

i WILL MAKE A TUTORIAL FOR THIS & no one will get error! i understand everything because i was trying to make a db connection from another server like 4 hours and finally i did!!!!!!

i had wrong username xD

I guess it can be locked then.
Guest
This topic is now closed to further replies.


  • Posts

    • Added: 🎁 Seasonal Bonus System When the seasonal bonus is enabled, players receive additional bonus coins equal to bonus_season_percent of their donation amount. 💡 How it works (example): A player donates through their personal account and immediately receives regular coins. At the same time, bonus coins equal to 30% of the donation are credited. Example: Donation: 1000 coins → Bonus: 300 coins (30%) These bonus coins are not available immediately — they can be claimed later when the next season begins. 📅 When the bonus can be claimed: bonus_season_claim_start_date – the date when the "Claim" button becomes available. bonus_season_claim_end_date – the date after which the bonus can no longer be claimed. During this time window, the "Claim" button will appear in the personal account, allowing players to collect their accumulated bonus. 'bonus_season_enabled' => true, // Enable/disable the seasonal bonus system 'bonus_season_percent' => 30, // Percentage of the donation to be given as bonus coins (30 = 30%) 'bonus_season_claim_start_date' => '2025-07-30 00:00:00', // Date when the Claim button becomes available in the new season   'bonus_season_enabled' => true, // Вкл./Выкл Сезонную бонусную систему? 'bonus_season_percent' => 30, // Процент, при донате получает монеты в процентах 30 = 30%, которые может использовать в следующем открытии 'bonus_season_claim_start_date' => '2025-07-30 00:00:00', // Дата когда доступна кнопка Claim в новом сезоне 'bonus_season_claim_end_date' => '2025-08-15 20:00:00', // Дата окончания когда кнопка Claim в новом сезоне
    • Discord         :  utchiha_market Telegram        : https://t.me/utchiha_market  
    • HELLO EVERYONE. WE ARE SELLING A LOT OF ADENA ON L2 REBORN DISCORD - GODDARDSHOP   HURRY TO BUY OR YOU MAY NOT MAKE IT!!!
    • you can find the extender at GX-EXT Discord! http://prntscr.com/coUwKnD4Zs_w https://l2servers.com.ar/   @GX-Ext
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock