iConomy MySQL Database

Discussion in 'Bukkit Help' started by MegaNarwhal, May 30, 2012.

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


    1. What OS are you using: Windows Vista 64-Bit SP2
    2. What architecture is the OS you are running: x86
    3. What version and architecture is your java install: 1.6.0_31 64-Bit
    4. Are you running any wrappers: No
    5. What build of CraftBukkit are you running: 1.2.5 R3.0

    I've recently tried to set up a MySQL database for several plugins my server has using XAMPP. I was able to configure it and added a database, then configured iConomy to use the database, but when I run my Minecraft server, this is what I get in the console:

    [INFO] [iConomy] Database Error: com.mysql.jdbc.exceptions.jdbc4.MySQLS
    yntaxErrorException: Unknown database 'minecraft'

    And as you can see, there is indeed a database named minecraft on MySQL.


    It's not only iConomy, I've tried two other plugins and none worked with SQL.
    Here's my iConomy configuration:
    Show Spoiler

    # iConomy 6.0.8b

    # Should a user have the 'iConomy.holdings' to use /money
    # By default this is false, so that people stop complaining that
    # iConomy doesn't work. Yes, people actually report that.
    # If you are one of those people, leave this false.
    Holdings: true

    # Major is the first segment [Major].Minor

    # Major ([Major].Minor) 1.00 Dollar (With Seperate 1 Dollar)
    Major: [ 'n', 'n' ]

    # Minor (Major.[Minor]) 0.23 Coins (With Seperate 0 Dollars, 23 Coins)
    Minor: [ 'Coin', 'Coins' ]

    # Default account balance when created
    Holdings: 10.0

    # Controls how money is formatted through methods
    # Minor allows you to use the Minor amounts for amounts <1
    # Example (true) 0.23 Coins and 1.23 Dollars (false) 0.23 Dollars and 1.23 Dollars
    Minor: false

    # Seperate allows your money to be shown in an alternative way,
    # instead of 1.32 it will show as 1 Dollar 23 Coins
    # !!! NOTICE: This only works if Minor is set to true !!!
    Seperate: false # Example (true) 1 Dollar, 23 Coins (false) 1.23 Dollars (Only if Minor is true)

    # Single shows your money in another alternative way.
    # Instead of 1.23 Dollars you will see: 1 Dollar.
    # If your money is 0.23 you will see 0 Dollars if Minor is false, 23 Coins if Minor is true.
    # !!! Notice: This overrides seperate !!!
    Single: false

    # Logs all monetary transactions passed through iConomy
    Enabled: false

    # Purges Default Balances at Loading
    # Good way to keep unused accounts or default accounts wiped out and lower database usage.
    Enabled: true

    # Controls amount of money gained at a set interval.
    Enabled: false

    # Only give interest to players who are currently online?
    Online: true

    # Send a message when the player gains interest?
    Enabled: false

    Seconds: 60

    # The balance to be met where we stop giving interest.
    # 0.0 for no limit
    Cutoff: 0.0

    # Percentage of holdings to give / take (Negative to take) (Overrides Min/Max)
    Percent: 0.0

    # This is range based, to set a "flat" or "constant" rate, set each (Maximum and Minimum) to the same number.
    # If the two numbers are different, it will be a random amount in-between the two.
    Maximum: 1
    Minimum: 2

    Type: 'mysql'
    MajorItem: 266
    MinorItem: 265

    # This controls the database name, by default it is iConomy
    Table: 'minecraft'

    # URL is for SQL Databases Only
    # Path to iConomy folder is easy, it's the COMPLETE path.
    # (Mine) G:\MineCraft\plugins\iConomy\
    # Won't be the same as yours, but it usually looks like that.
    # [H2DB Default] h2:path/to/iConomy/folder/iConomy;AUTO_RECONNECT=TRUE
    # [SQLite Default] sqlite:path/to/iConomy/folder/iConomy.db
    # Binary Databases use ip:port style connections.
    # ip
    # - is the connection identifier (internet protocol)
    # - for ipv6 usually encased in brackets [::1]
    # port
    # - the port that the database is listening on
    # - defaults: 3306 for mysql, postgre is either 5740 or 5432
    # [MySQL Default] mysql://localhost:3306/iConomy
    # [Postgre Default] postgresql://localhost:5740/iConomy
    URL: 'mysql://localhost:3306/minecraft'

    # Login details for binary databases
    Username: 'root'
    Password: '******'

    # Set to True, After converting, change this back to false!
    Enabled: false

    # Database Type, H2DB or MySQL
    Type: 'MySQL'

    # Database Table
    Table: 'minecraft'

    # Database URL without table at the end.
    URL: 'mysql://localhost:3306'

    # Username / Password
    # H2DB does not use this. MySQL Only.
    Username: 'root'
    Password: '******'

    # Unused ATM.
    All: true

    Any help is greatly appreciated!
  2. Offline


  3. Offline



    1. Stick to x86 software with an x86 os (java 64...)
    2. Do you have a user that has access to the minecraft database? Did you setup the login/pass for that user in your plugins?
  4. Offline


    1. I have the right one, yes?
    2. I'm using the root user for connection to the database. From the looks of the error, it can't FIND the database. Could it be Xampp? I've tried Wamp, but that wouldn't work because apparently it couldn't find a dll or something.
  5. Offline


  6. Offline


    If you are using Essentials I would use EssentialsEcon if I was you. I use to use it and it works well. Just my opinion. Also Torrent (I think) has a well done tutorial on how to do mySQL.
  7. Offline


    First, I don't advice you to use xampp, it gives more features than you need. I suggest using the standalone MySQL server. I wrote a guide about configuring it, maybe it can help you? you can find a link in my signature =)
  8. Offline


    zipron, I'm trying your tutorial right now. That's what I was originally going to do but then I looked up a tutorial video for SQL and they were using XAMPP, but it doesn't work for me. I'll tell you how it goes :)

    zipron I tried to install it, but probably due to my previous installation the configuration wizard stops working when it gets to the Starting Service step... Is it ok to not use it as a service?

    I tried to install it without it being a service and it gets past that screen, but does not set a password. Then when I try to use it, without a password, it says something about not being able to connect to localhost and then very quickly closes. :( What do I do?

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


    I've never done such a tutorial!
  10. Offline


    Be sure to remove all mysql installations before tryiing to re-install, if you don't manage to remove it, you can use this awesome free tool: http://www.revouninstaller.com/revo_uninstaller_free_download.html (free download at the bottom of the page)

    I hope you're not discouraged because you have to do all this, believe me, once your MySQL server is working, you never want flatfiles again =)
    Torrent hi mr. youtube, I know you but you don't know me, scary right? xD
    Torrent likes this.
  11. Offline


    zipron Xampp showed up in Revo Uninstaller but the regular SQL server didn't. :oops: I must've done something really wrong o.o Either way, both are (at least they're supposed to be) uninstalled, and I'm rebooting my computer.

    EDIT: Restarted, following your tutorial word-for-word.
  12. Offline


    Hmm yea had some issues too few years ago with mysql server wrongly installed and not being able to remove it, but normally, if you use revo, and uninstall xampp, it'll automatically search for all assosiated files (and normally MySQL is than removed with it, if you did the uninstall correctly with revo)

    again, don't give up hope, in a few months someone new will ask on this forum for help, and you'll be able to answer it like a pro =D
  13. Offline


    The user you are connecting with probably doesn't have permissions to see the database you have specified in the plugin configuration.

    Also check the access IPs for the user you're trying to connect with - if the mysql and minecraft servers are not on the same machine.
  14. Offline


    zipron I was able to get it past the instance configuration with it being a service, however I had to select the "Non-transactional database" option when configuring it. Does this cause any problems with plugins using the database?
    andrewpo I was using the root user for the plugins. Is that a problem?
  15. Offline


    You should always avoid using the root user - that's a massive security risk (I'd most likely lose my job if I did that in one of my programming projects)

    Create a new user in MySQL (if you have phpmyadmin it's in the privileges section) and give it access rights to your minecraft database.

    Putting your config file on pastebin might also help us in resolving your problem.
  16. Offline


    Getting closer! This is the console error, and it's because of the configuration of MySQL:

    Show Spoiler
    12:54:13 [INFO] [iConomy] Error creating database: java.sql.SQLException: Unknow
    n storage engine 'InnoDB' Query: CREATE TABLE IF NOT EXISTS `minecraft` ( `id`
    int(255) NOT NULL AUTO_INCREMENT, `username` varchar(32) NOT NULL, `balance
    ` double(64,2) NOT NULL, `status` int(2) NOT NULL DEFAULT '0', UNIQUE KEY `u
    sername` (`username`), PRIMARY KEY `id` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET
    =utf8; Parameters: []

    andrewpo: This is my SQL config... How would I fix the error above?
  17. Offline


    Comment out the config line "skip-innodb"

    Line 167

    Put a hash at the start of the line.
  18. Offline


    andrewpo: Thanks. I'm testing it now.
    EDIT: MySQL just immediately closes right after I start it with the new config. :(
    EDIT: Fixed it, but I get the same error even with it commented out.
  19. Offline


    Have you tried changing the storage engine for the tables from innodb to myisam?
  20. Offline


    # The default storage engine that will be used when create new tables when

    andrewpo: Looks like it's already set to that.
  21. Offline


    No, in the plugin configuration - not MySQL.

    This is more of a MySQL issue than Bukkit - try asking on a website like stackoverflow or the official mysql forums for support.
  22. Offline


    Ok. Thanks for all the help andrewpo and zipron :) I'll let you know how it turns out.
  23. Offline


    Turns out all I had to do was delete ib_logfile0 and ib_logfile1 in the data folder because they were messed up. SQL now works on my server! :D Thanks for the help.
Thread Status:
Not open for further replies.

Share This Page