Setting up SQL for PEX

I have been working on this for a few days and it seems no matter what I do I can’t get the sql database to connect to SQL database. I have found info that my SQL might be running on MineOS and I did what I thought was required to get it working and when I test to see if I can connect to SQL it don’t connect. What am I doing wrong?

sql:
  type: sql
  uri: mysql://localhost/exampledb
  user: databaseuser
  password: databasepassword

After some deep research I found out I need to confirm that SQL is working fine on MineOS. I know it’s running but I’m having trouble testing to make sure ports are open for it to work.

First question–what distro are you using?

MineOS Turnkey comes with MySQL pre-installed, but MineOS itself (the webui installed any other way) does not install any SQL database.

If you’re connecting from the host to the host (which seems to be the case because of your use of localhost, ports are irrelevant–they won’t be stopped by the firewall (in the case of MineOS Turnkey) because the firewall only stops inbound/outbound traffic.

I believe its Turnkey I downloaded the latest a few months ago, and I’m not using any host, it localhost just not working, The how to find out if mysql is running on linux gave me results. The results Uptime: 31187 Threads: 1 Questions: 128 Slow queries: 0 Opens: 48 Flush tables: 1 Open tables: 41 Queries per second avg: 0.004. I will remove the firewall entry since it’s not needed.

I believe my problem is creating the database, not having the correct steps to do it.

Are you using the instructions from the github wiki for PEX?

have you set the root password for MySQL?

I don’t think it’s a password issue since I can log into root at command line using this command mysql -u root -p. For Pex I am using uri: mysql://localhost/pex_permissions user: root and same password I used to log into mysql as root get 3 errors in logs at boot up.

http://pastebin.com/EQeR8TrP

1/ does the plugin create the database?
2/ If not when I create the database do I need to assign a user to it?

Steps I figured out so far, still not working;

MYSQL -u root -p
Password
CREATE DATABASE DatabaseName;
GRANT ALL ON PEX.* to ‘root’@‘localhost’ identified by ‘password123’;
FLUSH PRIVILEGES;

multiserver:
use-netevents: true
permissions:
debug: ture
allowOps: false
user-add-groups-last: false
log-players: false
createUserRecords: false
backend: sql
informplayers:
changes: false
basedir: plugins/PermissionsEx
backends:
backend: sql
backends:
sql:
type: sql
uri: mysql://localhost/PEX
user: root
password: password123
updater: true
alwaysUpdate: false

When you edit your post text, we can’t tell if you typed in “DatabaseName” here, and “PEX” on the second line, vs, “PEX” in both places, etc.

There is no danger to letting us know what you call your database, but it does stop us from knowing what you’re doing that’s not working.

I copied from my notes and missed to change one of the generic commands I copied off the web. Also I have created a user and using MySQL-Front I try to connect and get a #1045 error I have reset my password and dropped user and created again still can’t connect.

MYSQL -u root -p
Password
CREATE DATABASE PEX;
GRANT ALL ON PEX.* to ‘root’@‘localhost’ identified by ‘password123’;
FLUSH PRIVILEGES;

multiserver:
use-netevents: true
permissions:
debug: ture
allowOps: false
user-add-groups-last: false
log-players: false
createUserRecords: false
backend: sql
informplayers:
changes: false
basedir: plugins/PermissionsEx
backends:
backend: sql
backends:
sql:
type: sql
uri: mysql://localhost/PEX
user: root
password: password123
updater: true
alwaysUpdate: false

I was wondering how the SQL Databases get backed up?
OK the above steps worked fine, my issue was with mysql. I found a site to remove it and then I reinstalled now it works, steps I took to fix;

sudo service mysql stop #or mysqld
sudo killall -9 mysql
sudo killall -9 mysqld
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
sudo deluser mysql
sudo rm -rf /var/lib/mysql
sudo apt-get purge mysql-server-core-5.5
sudo apt-get purge mysql-client-core-5.5
sudo rm -rf /var/log/mysql
sudo rm -rf /etc/mysql

sudo apt-get install mysql-client-5.5 mysql-server mysql-server-core-5.5