Connecting to remote MySQL help.

Discussion in 'Bukkit Help' started by CRAZYxMUNK3Y, Feb 3, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    CRAZYxMUNK3Y

    Hi all...

    I am currently trying to set up FigAdmin MySQL with the following site; 000webhost.com

    I have changed the configs that need to be changed in the "banlist.php" file
    PHP:
      $server "mysql17.000webhost.com";
      
    $dbuser "a1604052_banlist";
      
    $dbpass "THE PASS";
      
    $dbname "Sub-Terran Ban List";
    But when i load the server, it shows the following errors
    Errors (open)

    2012-02-04 13:58:25 [INFO] [FigAdmin] Loading FigAdmin v4.0.12.
    2012-02-04 13:58:25 [SEVERE] Unable to retreive connection
    java.sql.SQLException: No suitable driver found for a1604052_banlist?autoReconnect=true&user=a1604052_banlist&password=THE PASS
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at com.btbb.figadmin.MySQLDatabase.getSQLConnection(MySQLDatabase.java:52)
    at com.btbb.figadmin.MySQLDatabase.getSQLConnection(MySQLDatabase.java:63)
    at com.btbb.figadmin.MySQLDatabase.initialize(MySQLDatabase.java:75)
    at com.btbb.figadmin.FigAdmin.onEnable(FigAdmin.java:82)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:231)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:1057)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:379)
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:191)
    at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:174)
    at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:357)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:344)
    at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:175)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:408)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)
    2012-02-04 13:58:25 [SEVERE] Error occurred while enabling FigAdmin v4.0.12 (Is it up to date?): null
    java.lang.NullPointerException
    at com.btbb.figadmin.MySQLDatabase.initialize(MySQLDatabase.java:76)
    at com.btbb.figadmin.FigAdmin.onEnable(FigAdmin.java:82)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:231)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:1057)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:379)
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:191)
    at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:174)
    at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:357)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:344)
    at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:175)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:408)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)


    Is there something that needs to be added to the remote database? or am i missing something really simple? :S

    PS. Sorry if this is a noob question, i don't know much about MySQL or PHP.

    Thanks
     
  2. Offline

    hammale

    looks like u need to get the MySQL driver...
     
  3. Offline

    CRAZYxMUNK3Y

    Where can that be found and where would i place it?

    This is what comes up on the site :(
     
  4. Offline

    c0mp

    If it's referring to what I think it's referring to when it says it needs a driver, try creating a folder called lib next to your CraftBukkit.jar file, then go into the lib folder and drop this file into it. You'd probably have to restart the server, but see if that satisfies FigAdmin.
     
  5. Offline

    CRAZYxMUNK3Y

    I did that... but it still shows the errors :S

    Would it help if i put up screen shots of the plugin config, banlist.php and website? If so, what else?

    Thanks
     
  6. Offline

    FunCraft

    If you use the free web hosting from 000webhost.com you can't use remote access with the MySQL database located on their servers.
     
  7. Offline

    CRAZYxMUNK3Y

    Ohhk... Is there a site that does allow it?

    Thanks
     
  8. Offline

    FunCraft

    you can find plenty of free MySQL hosts if you google it
    i won't go to one of those cause they usually don't give you unlimited columns for the database's tables
     
  9. Offline

    CRAZYxMUNK3Y

    FunCraft c0mp hammale

    Late reply sorry, but have been on holidays and missed it :S

    New page i am trying... Only one error for this tine which is better.

    PHP:
     // Line 34 which is showing errors
    while($row mysql_fetch_assoc($result)){
     
    if(
    $col == "#eeeeee"){
    $col "#ffffff";
    }else{
    $col "#eeeeee";
    }
    echo 
    "<tr bgcolor=$col>";
     
    echo 
    "<td>".$row['name']."</td>";
    echo 
    "<td>".$row['reason']."</td>";
    echo 
    "<td>".$row['admin']."</td>";
    echo 
    "<td>".date("d M, Y g:ia",$row['time'])."</td>";
    if(
    $row['temptime'] == "0"){
    echo 
    "<td>∞</td>";
    }else{
    echo 
    "<td>".date("d M, Y g:ia",$row['temptime'])."</td>";
    }
     
    echo 
    "</tr>";
    }
    Also, adding the connector did not fix the issue sory to say :(

    What is wrong?

    Thanks
     
  10. Offline

    c0mp

    I'm no pro at PHP by any stretch of anyone's imagination, but where is $result being defined? And what does it return if you were to just echo it?
     
  11. Offline

    rmsy

    CRAZYxMUNK3Y
    You can't use spaces in MySQL database names.
     
  12. Offline

    CRAZYxMUNK3Y

    Nothing is shown when i just Echo it;
    and this is where it is defined;
    PHP:
    $result mysql_query("SELECT * FROM banlist ORDER BY time DESC");
    I changed it to have no spaces... Still shows errors :S


    Here is the whole code if you need (ex HTML parts);

    PHP:
    <?php
     
    // change these things
     
      
    $server "sub-terran-bans_zxq_bans";
      
    $dbuser "663137_bans";
      
    $dbpass "THE PASS";
      
    $dbname "Sub-Terran-BanList";
     
    mysql_connect($server$dbuser$dbpass);
    mysql_select_db($dbname);
     
    $result mysql_query("SELECT * FROM banlist ORDER BY time DESC");
     
    echo 
    "<table width=70% border=1 cellpadding=5 cellspacing=0>";
     
    echo 
    "<tr style=\"font-weight:bold\">
    <td>Name</td>
    <td>Reason</td>
    <td>Admin/Mod</td>
    <td>Time of ban</td>
    <td>Time of unban</td>
    </tr>"
    ;
     
    while(
    $row mysql_fetch_assoc($result)){
     
    if(
    $col == "#eeeeee"){
    $col "#ffffff";
    }else{
    $col "#eeeeee";
    }
    echo 
    "<tr bgcolor=$col>";
     
    echo 
    "<td>".$row['name']."</td>";
    echo 
    "<td>".$row['reason']."</td>";
    echo 
    "<td>".$row['admin']."</td>";
    echo 
    "<td>".date("d M, Y g:ia",$row['time'])."</td>";
    if(
    $row['temptime'] == "0"){
    echo 
    "<td>∞</td>";
    }else{
    echo 
    "<td>".date("d M, Y g:ia",$row['temptime'])."</td>";
    }
     
    echo 
    "</tr>";
    }
     
    echo
    "</table>"
     
    ?>
     
  13. Offline

    c0mp

    Try implementing some error-handling, just in case. Change:
    PHP:
    mysql_connect($server$dbuser$dbpass);
    mysql_select_db($dbname);
    $result mysql_query("SELECT * FROM banlist ORDER BY time DESC");
    to something like:
    PHP:
    try {
        
    mysql_connect($server$dbuser$dbpass) or throw new Exception("Could not connect to MySQL!");
        
    mysql_select_db($dbname) or throw new Exception("Could not select database!");
        
    $result mysql_query("SELECT * FROM banlist ORDER BY time DESC");
    } catch (
    Exception $e) {
        echo 
    'ERROR: '$e->getMessage(), "\n";
    }
    Hopefully your PHP expertise will at least get the gist of what I'm trying to do here, if the above isn't quite right. To reiterate, PHP is not a strong point of mine. ;)
     
Thread Status:
Not open for further replies.

Share This Page