Plugins MySQL Access

Discussion in 'Plugin Development' started by tanaka141, May 19, 2011.

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

    tanaka141

    I make a private plugin for a minecraft server, i use with it a MySQL database.

    With it, I use anothers plugins, some can use MySQL database or some other database type.

    The big problem is each plugin use his own config.yml to make the connection to the database.

    To reduce the number of config file to modify or control to give access to one MySQL database, can it be possible to make a one config file to configure the database access ?

    My idea is a config.yml in the plugins directory where we can enter informations as that :
    Code:
    database:
    
        connection:
    
            type: MySQL
    
            port: 3306
    
            user: mysqluser
    
            password: mysqlpassword
    
       plugins:
    
            iConomy
    
            mcMMO
    or another type :
    Code:
    database:
    
        connection:
    
            type: MySQL
    
            port: 3306
    
            user: mysqluser
    
            password: mysqlpassword
    
    plugins:
    
       iConomy:
    
            database
    
       mcMMO:
    
            database
     
  2. Offline

    AOD_Batman

    So like a built-in ConnectionManager into Bukkit so instead of mcMMO and iConomy having two separate connections to the same MySQL server there is only one?

    If so I approve!
     
  3. Offline

    tanaka141

    i took mcMMO and iConomy as example, but this will be for all others plugins

    no one is ok for this ?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 15, 2016
  4. Offline

    Jayjay110

    seems too hard or long to do :p
     
  5. Offline

    fugue2005

    bukkit already has a built in MySQL connection manager, it's why it went from 2 megs to 8 megs in one build.
    it was installed for persistence for the eventual bukkit permissions release.

    Code:
    database:
        username: mysqluser
        isolation: SERIALIZABLE
        driver: com.mysql.jdbc.Driver
        password: mysqlpass
        url: jdbc:mysql://localhost/minecraft
    settings:
        update-folder: update
    this goes in bukkit.yml in your minecraft root folder
     
  6. Offline

    tanaka141

    My idea is to give the possibility to each people having a server to select different MySQL server for each plugins and in one file, if the bukkit.yml is available, this can be use to put theses information

    then this file can be as this :
    Code:
    database:
        username: mysqluser
        isolation: SERIALIZABLE
        driver: com.mysql.jdbc.Driver
        password: mysqlpass
        url: jdbc:mysql://localhost/minecraft
    settings:
        update-folder: update
    plugins:
        database:
           minecraftdb1:
                username: mysqluser
                driver: com.mysql.jdbc.Driver
                password: mysqlpass
                url: jdbc:mysql://localhost:3306/minecraft
    
           minecraftdb2:
                username: mysqluser
                driver: com.mysql.jdbc.Driver
                password: mysqlpass
                url: jdbc:mysql://localhost:3306/minecraft
        list:
               iConomy: minecraftdb1
               mcMMO: minecraftdb2
               sqlPermissions: minecraftdb1
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 15, 2016
  7. Offline

    fugue2005

    that sounds like an awesome idea, have you submitted it to leaky.bukkit.org?
     
  8. Offline

    tanaka141

    For me,this is an idea that plugin developper that can use, not only bukkit developper
    but bukkit would use it to initialize the server
     
Thread Status:
Not open for further replies.

Share This Page