mySQL firewall entry

321 views
Skip to first unread message

Simon Platten

unread,
May 28, 2013, 1:34:49 PM5/28/13
to beagl...@googlegroups.com
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,

Simon Platten

unread,
May 29, 2013, 2:56:41 AM5/29/13
to beagl...@googlegroups.com
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.

Venkat Bommakanti

unread,
May 29, 2013, 12:52:48 PM5/29/13
to beagl...@googlegroups.com
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

Simon Platten

unread,
May 29, 2013, 1:31:30 PM5/29/13
to beagl...@googlegroups.com
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


On Tuesday, 28 May 2013 18:34:49 UTC+1, Simon Platten wrote:

Jason Stapels

unread,
May 29, 2013, 8:14:26 PM5/29/13
to beagl...@googlegroups.com
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.

Simon Platten

unread,
May 30, 2013, 2:42:42 AM5/30/13
to beagl...@googlegroups.com
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.




On Tuesday, 28 May 2013 18:34:49 UTC+1, Simon Platten wrote:

ht51...@gmail.com

unread,
Jun 29, 2013, 6:33:04 PM6/29/13
to beagl...@googlegroups.com
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

Simon Platten

unread,
Jun 30, 2013, 3:30:56 AM6/30/13
to beagl...@googlegroups.com, ht51...@gmail.com
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;
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/TOZG62o_OBA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


--

Kind Regards,
Simon A. Platten

View
            Simon Platten's profile on LinkedIn About Me...

ht51...@gmail.com

unread,
Jun 30, 2013, 2:07:31 PM6/30/13
to beagl...@googlegroups.com, ht51...@gmail.com
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

ht51...@gmail.com

unread,
Jun 30, 2013, 3:33:08 PM6/30/13
to beagl...@googlegroups.com, ht51...@gmail.com
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

On Sunday, June 30, 2013 12:30:56 AM UTC-7, Simon Platten wrote:

moolyachi...@gmail.com

unread,
Jul 28, 2014, 9:41:31 AM7/28/14
to beagl...@googlegroups.com, ht51...@gmail.com
hi simon,

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

Simon Platten

unread,
Jul 29, 2014, 3:20:19 AM7/29/14
to beagl...@googlegroups.com
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;
Reply all
Reply to author
Forward
0 new messages