[Guide] Full guide for creating a MySQL database for use with plugins on Ubuntu/Debian

Discussion in 'Bukkit Help' started by desmin88, Apr 5, 2011.

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

    desmin88

    Various plugins like LogBlock/BigBrother use a MySQL database to function, or can use a MySQL database to function. However, for a beginner server admin and savvy alike, it can be a daunting process. Therefore, I'm making a quick and easy guide on how to step-by-step install mysql, configure it, and make a database.

    +Part 1: Installing MySQL
    +Part 2: Creating a user and database

    Part 1:
    Lets begin to install MySQL's files:
    Open an SSH terminal and type in sudo apt-get install mysql-server > hit enter
    This will ask you a y/n question, answer yes. Then, it will ask you for a root password. Enter in a secure password and write it down/remember it.
    then type in sudo apt-get install mysql-client > hit enter
    Again, answer yes to the question. They basically ask if you want to install it. Now, you are done with installing the two packages you'll need for MySQL. Not so hard, right?

    Part 2:
    Lets create the database within MySQL
    In an SSH Terminal, type this and hit enter mysql -u root -p
    It asks you for that root password. Enter it, however, you wont see it typing, it's invisible. Just hit enter when your done.
    Now you'll see something like this: mysql>.
    In that, type this to create your database mysqladmin -u root -p create minecraft
    This will prompt you for the root password again. Enter it! Congratulations, you've made a database called, minecraft.
    Lets enter this mysqladmin -u root -p reload, to reload MySQL. Enter your root password again.
    Database done! Now, lets create your user that the plugin will use, enter this in the terminal
    GRANT ALL ON minecraft.* TO user@localhost IDENTIFIED BY 'mypassword'
    Replace mypassword, with well, your password. User can also be changed for the username.

    Congratulations! You've installed MySQL, made the database 'minecraft', and made a user for it as well.
    Now, you can use LogBlock,BigBrother or all those other good plugins using a database. I wont touch base on DB Tables, as most plugins auto generate those for you now.
    Enjoy!



     
    Sanity_x likes this.
  2. Offline

    Sanity_x

    Thanks, really help full tutorial :D
     
  3. Offline

    desmin88

    Thanks!
     
  4. Offline

    Lanuk

    Sorry... but what in the world is an SSH terminal and how do I get it o.o
     
  5. Offline

    desmin88

    @Lanuk
    If you don't know what an SSH terminal is, well, you shouldn't be running a server to be honest.
     
  6. Offline

    TuRmoiLxx

    My server runs Linux but its a GSP for MineCraft. I asked them on regards to installing MySQL and they told me I should order a webhosting service from their website. I'm thinking of ordering it since its 2$ monthly for 2GB space, and all I'm mainly doing is hosting a small forum and a MySQL Database. Heres their offer:

    Disk space choice from 2 GB to 100 GB : you will always be able to change your offer, to adapt it to your needs of disk space.
    Single FTP access : control all your website data with a single FTP access (including Apache logs).
    1 MySQL Database : you will have a database, with a maximum size of 50MB.
    PhpMyAdmin Pre-installed : this tool will allow you to manipulate your database very easily.
    PHP4 / PHP5 : the latest Web technologies PHP are available on the hosting.


    You think I could manage a MySQL database with it?


     
  7. Offline

    desmin88

    @TuRmoiLxx
    If you dont run a mySQL database locally on the same server that you run the minecraft server on, lag with increase. 50MB probably won't be big enough as well. If you GSP provider won't even let you install mySQL, you might need to rethink your choice.
     
  8. Offline

    TuRmoiLxx

    I've been thinking of doing so. Thing is I've built trust with this company. I'm willing to open up to other companies but I'm a very safe person regarding MY money. Money doesn't flow fluently for a 13 year old you see.
     
  9. Offline

    desmin88

    @TuRmoiLxx
    They should just let you install a local database. Without that, just use a flatfile or something I guess.
     
  10. Offline

    TuRmoiLxx

    how would a flatfile work? I'm completely noob with MySQL and I'm opened to learning/being taken under the wing.
     
  11. Offline

    desmin88

    @TuRmoiLxx
    Plugins that use SQL databases can sometimes also use flatfiles, which don't need installation of anything. It's like a plain txt file.
     
  12. Offline

    TuRmoiLxx

    would LogBlock or BigBrother be one of those plugins?
     
  13. Offline

    desmin88

    BigBrother has that option. LogBlock, doesn't.
     
  14. Offline

    TuRmoiLxx

    could you explain to me how to use it with BigBrother via Inbox? I don't want to spam up the forums ^^.
     
  15. Offline

    desmin88

    Simply don't select the option to use mySQL. BigBrother uses something called H2 I believe, and it's all explained in the original post of bigbrother.
     
  16. Offline

    Lanuk

    my bad.. I missed the "ubuntu/debian" line at the bottom. Is there a guide out there that tells you how to do this in windows 7 ;_;
     
  17. Offline

    MacVaultDweller

    Can you show instructions for Mac OSX
     
  18. Offline

    Pencil

    I loled so hard, Lanuk u got pawned so hard :D

    Anyways, on windows this is easy as hell. Install MySQL, download some client like navicat, login and create the database :p
     
  19. Offline

    jacob863

    This is great but does anyone have a tut for Mac OS?
     
  20. Offline

    Lanuk

    Okay, lets assume I have no idea what MySQL even is, how to download it properly, do with it after I download it, how the heck to get this "client" thing and how in the world to create a database. I got to this thread using a link that didn't mention linux at all by the way >.>

    And yeah, no one so far can teach me how to do this... yes I have tried that wonderful search engine called Google.
     
  21. Offline

    Pencil

    Lanuk, come to my server and i'll talk you through ._.
     
  22. Offline

    Lanuk

    Holy... you aren't iPencil... are you o.o
     
  23. Offline

    Pencil

    Jackpot ._. Guess why I quoted you out of that chunk of posts.
     
  24. Offline

    Lanuk

    It's a small Bukkit world :p

    I'll come down I suppose, I appreciate it. I got BigBrother running after learning it doesn't require MySQL, but it is kind of buggy at the moment.
     
  25. Offline

    Pencil

    With the ammount of questions you have, i had to stumble accross you one day ;D
     
  26. Offline

    Lanuk

    Ha, very funny :p

    For your information I had my Bukkit server running well before you even decided to move to bukkit >.<

    Just... I don't know anything about MySQL is all... :3
     
  27. Offline

    Pencil

    and you base that of what? I had bukkit running the first day a working public build was put up
     
  28. Offline

    Lanuk

    Thats weird o.o

    Last time I remembered you didn't budge from hmod or whatever until it really started getting glitchy (By that time I had already started being inactive)
     
  29. Offline

    Pencil

    I never said I had it live.
     
  30. Offline

    Lanuk

    Ahh, cool. I think this is getting a bit off topic now lol. I'll stop replying. And if you don't mind I might come on your server later for that MySQL help when you're not as busy :3
     
Thread Status:
Not open for further replies.

Share This Page