Solved Need Help with mySQL!

Discussion in 'Spigot Plugin Help' started by MGPro, May 21, 2017.

  1. Hello,
    I am needing some help setting up mySQL on my network.
    I am running Ubuntu 16.04 on a root server and i am hosting all of my servers on there and i need to connect all of the ranks together on each server! So say i buy a rank on Kitmap on every other server he gets the rank.

    But i do not know how to do that. All i really know is i could use sexypex or mySQL and i dont really have the money to buy sexypex at this moment so ye. So could someone help me???
    Thanks a lot!
  2. PermissionsEX has a built in feature wich supports MySQL. Just google a little and you'll be able to figure it out on your own.
    • Agree Agree x 1
  3. Its fine i already did it btw its pretty confusing for someone new to mySQL. i just set it all up with a root server ubuntu and the about of shit i needed to do was crazy so ye that doesn't really help if i still didn't know how to do it xD
  4. Just for the people who don't know how to do this and looked at this thread to find a way. here you go!

    Pretty much if you have a root server running ubuntu 16.04. Open the screen/kvm and do the following :
    • sudo apt-get update
    • sudo apt-get install mysql-server
    • sudo mysql_secure_installation
    • systemctl status mysql.service (this is too test if you have installed it properly)
    This should be the output of systemctl status mysql.service!

    mysql.service - MySQL Community Server
    Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: en
    Active: active (running) since Wed 2016-11-23 21:21:25 UTC; 30min ago
    Main PID: 3754 (mysqld)
    Tasks: 28
    Memory: 142.3M
    CPU: 1.994s
    CGroup: /system.slice/mysql.service
    └─3754 /usr/sbin/mysqld

    if it does not show this do this then do the test command once again after this!
    • sudo systemctl mysql start
    And there you have installed it but im guessing you want to know the rest on how to get it setup with ranks and pex and stuff!

    • mysql -u root -p (after this you should be prompt with a password the password is the one you did on step 3)
    • CREATE DATABASE database_name; (Change datdabase_name to something else what ever you want but make sure you remember it!)

    • grant all privileges on database_name.* to 'username_you_want'@'localhost' identified by "choose_your_password_here";
    • flush privileges;
    • exit
    And there you now have your database!!!

    Now to add it to pex so all your servers can use it!

    • Make a copy of your permissions in your pex config first
    • Then delete your pex folder AFTER YOU MADE YOUR BACKUP!
    • Then reload all of your servers
    • In your game after that do /pex backend sql dont worry if you get a error thats good!
    • then there should be another pex folder there click on it and press on config
    • Then when your in the config change the "backend: file" to "backend: sql"
    • Below that there should be a backend called sql.
    • Now change that to what you put in the database in my case it will look like this!

    use-netevents: true
    debug: false
    allowOps: false
    user-add-groups-last: false
    log-players: false
    createUserRecords: false
    backend: sql
    changes: false
    basedir: plugins/PermissionsEx
    type: file
    file: permissions.yml
    type: sql
    uri: mysql://localhost/database_name
    user: username_you_want
    password: choose_your_password_here
    updater: true
    alwaysUpdate: false

    • Do that for each config for your servers and then reload each server and there you go!
    You now have a sql and pex connected to it! Now all you need to do is add the ranks and perms and stuff!