mySQL firewall entry

I’m trying to enable remote access to a mySQL database running on a beaglebone Black board. I have mySQL installed and running, but I cannot access it remotely, I believe this is a firewall issue and I’ve added the following to /etc/sysconfig/iptables:

*filter
:INPUT ACCEPT [32:2424]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [25:2380]
-A INPUT -i eth0 -p tcp -m tcp --dport 3306 -j ACCEPT
COMMIT

This configuration was table from the same file on a server running Centos 6, not sure if its correct for Angstrom, can anyone tell me if this is correct and if they’re is anything else I need to do?

Thank you,

Wasn’t a firewall issue in the end, have resolved the problem. The default installation was trying to create a PID file in /var/run/mysqld/

It couldn’t so the startup failed. Having specified this folder in my.cnf to be somewhere else where it could create the file, problem has gone away and I can not connect remotely to the unit.

Hi Simon,

Was this a part of an install of the LAMP stack or mySQL standalone ?
Could you pl. point to an online resource to build/install (for BBB if possible), or list the steps needed to get it built and running on the BBB.

thanks,
/venkat

The install come stright from the packages available when you type:

opkg list | grep mysql

You will need to update your packages if you haven’t already:

opkg update

Then

opkg install mysql5

Thats it, then configure /etc/my.cnf

Totally random side point, but mysql is kinda of a beast. If you can get away with using something on the ligher side like SQLite, I think you’ll find it’s a little more performant.

The reason I chose mySQL is because I’ve got two BBB configured to run in HA mode, which means that they are doing the same job as a much larger server set-up and so far its working really well.

SQLlite is ok for Android applications or very small applications, but like MS Access because everything is in one file, if you loose that file you loose everything. With mySQL and other database’s you have lots of options to repair and recover the data.

Simon,

Is there any account with ALL privileges after the installation? Could not find any way to create one that allows schema creation etc.

Thanks.

  • Hemant

Hi Hemant,

Can you be more specific in what you are asking? I only had to create one additional user for replication purposes. The priveledges I set for that are:

GRANT ALL PRIVILEGES ON *.* TO 'repl'@'localhost' IDENTIFIED BY 'BBB2013repl' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'repl'@'%' IDENTIFIED BY 'BBB2013repl' WITH GRANT OPTION;

qrcode.png

btn_viewmy_160x33.png

Hi Simon,

Basically, after the installation, I can connect to the DB with

mysql

without any password. But the account seem to have no privileges to perform ‘GRANT ALL …’ or ‘CREATE DATABASE’ or anything. So it is a ‘deadend’ account.
Strangely, I can connect to the DB with any string as account name with the same crippled access. So, for example I can do the following.

mysql -u notarealaccountname -p

with no password. Again I can’t do much after connecting though.

Also, /usr/bin/mysqladmin -u root password ‘toor’ fails with
/usr/bin/mysqladmin: Can’t turn off logging; error: ‘Access denied; you need the SUPER privilege for this operation’

Not sure what is broken.

Thanks,
Hemant

Simon,

Fixed the problem. It seems like for some reason all accounts had lost their privileges. So I had to start mysqld with --skip-grant-tables and then repair mysql.user table manually.

Thanks for all the help.
Hemant

hi simon,

i have same problem to accessing database remotely from beagal bone,
so what d solution for that

The firewall entries I published before resolved the issue for me.

Add:
GRANT ALL PRIVILEGES ON . TO ‘repl’@‘localhost’ IDENTIFIED BY ‘BBB2013repl’ WITH GRANT OPTION;

GRANT ALL PRIVILEGES ON . TO ‘repl’@’%’ IDENTIFIED BY ‘BBB2013repl’ WITH GRANT OPTION;