MySQL on Beaglebone Black

809 views
Skip to first unread message

Paul Van den Bergh

unread,
Nov 15, 2017, 5:38:49 AM11/15/17
to BeagleBoard

Hi all,

I have installed MySQL-server and MySQL-client on a BBB :

root@beaglebone:~# mysql --version
mysql  
Ver 15.1 Distrib 10.1.26-MariaDB, for debian-linux-gnueabihf (armv7l) using readline 5.2

I like to connect to it from a Windows machine using MySQL Workbench, but I'm not able to setup a connection :



root@beaglebone:~# cat /etc/mysql/my.cnf
# The MariaDB configuration file
# The MariaDB/MySQL tools read configuration files in the following order:# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
# 2. "/etc/mysql/conf.d/*.cnf" to set global options.
# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
# 4. "~/.my.cnf" to set user-specific options.
#
# If the same option is defined multiple times, the last one will apply.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.

#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]

# Import all .cnf files from configuration directory
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/
root@beaglebone
:~# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.1.26-MariaDB-0+deb9u1 Debian 9.1

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> SELECT User, Host FROM mysql.user;
+------+-------------+
| User | Host        |
+------+-------------+
| root | %           |
| root | 192.168.1.% |
+------+-------------+
2 rows in set (0.01 sec)

MariaDB [(none)]>

Any help is very welcome.

Thanks in advance,

Paul.
Auto Generated Inline Image 1

ta...@thinnect.com

unread,
Nov 15, 2017, 10:05:28 AM11/15/17
to BeagleBoard
The simplest debugging you could do is to attempt to create a TCP connection to the intended host and port. If this is accepted, then you have the TCP part working and only need to check MySQL configuration.

tcp 192.168.1.52 3306

--
Kind regards,
Tarmo Kuuse

ta...@thinnect.com

unread,
Nov 15, 2017, 10:05:32 AM11/15/17
to BeagleBoard
On Wednesday, November 15, 2017 at 12:38:49 PM UTC+2, Paul Van den Bergh wrote:
My mistake, the command would be:

telnet 192.168.1.52 3306

Paul Van den Bergh

unread,
Nov 15, 2017, 2:50:53 PM11/15/17
to BeagleBoard
Hi Tarmo,

Thanks for your reply.

When I try to open a telnet connection (via putty) to 192.168.1.52 port 3306, the connection is refused...




 What are my options to solve this?

Regards,
Paul

Auto Generated Inline Image 1
Auto Generated Inline Image 2

Dennis Lee Bieber

unread,
Nov 15, 2017, 5:55:25 PM11/15/17
to beagl...@googlegroups.com
On Wed, 15 Nov 2017 11:50:53 -0800 (PST), Paul Van den Bergh
<vdberg...@gmail.com> declaimed the
following:

>Hi Tarmo,
>
>Thanks for your reply.
>
>When I try to open a telnet connection (via putty) to 192.168.1.52 port
>3306, the connection is refused...
>
>
>
>
> What are my options to solve this?
>

Try with TELNET, not SSH!
--
Wulfraed Dennis Lee Bieber AF6VN
wlf...@ix.netcom.com HTTP://wlfraed.home.netcom.com/

Paul Van den Bergh

unread,
Nov 16, 2017, 4:25:13 AM11/16/17
to BeagleBoard
Same with telnet (from Debian in VirtualBox) :

paul@debian-9-2-1-64:~$ telnet 192.168.1.52 3306
Trying 192.168.1.52...
telnet
: Unable to connect to remote host: Connection refused



Op woensdag 15 november 2017 23:55:25 UTC+1 schreef Dennis Lee Bieber:

Tarmo Kuuse

unread,
Nov 16, 2017, 6:54:26 AM11/16/17
to BeagleBoard
On Thursday, 16 November 2017 11:25:13 UTC+2, Paul Van den Bergh wrote:
Same with telnet (from Debian in VirtualBox) :

paul@debian-9-2-1-64:~$ telnet 192.168.1.52 3306
Trying 192.168.1.52...
telnet
: Unable to connect to remote host: Connection refused




Then you can proceed to further debugging your setup. Some suggestions:

1. Verify that the IP you're connecting to is the IP of the Beaglebone ("ifconfig" on BB)
2. Verify that mysql service is running on the Beaglebone ("systemctl status mysql" on BB)
3. Verify that mysql is accepting connections on port 3306 from external hosts (no idea, refer to the docs)
4. Verify that there aren't any firewall rules to block traffic ("sudo iptables -L -n -v" on BB)
5. Go through the mysql logs for any failures (/var/log/mysql.*)

Paul Van den Bergh

unread,
Nov 16, 2017, 9:22:57 AM11/16/17
to BeagleBoard
Hi Tarmo,

1. since I can ssh into the BBB, it's the exact IP address:

paul@debian-9-2-1-64:~$ ssh root@192.168.1.52
Last login: Tue Oct 10 14:07:21 2017 from 192.168.1.13
root@beaglebone
:~# ifconfig
eth0
: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC>  mtu 1500
        inet
192.168.1.52  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80
::d239:72ff:fe17:eaae  prefixlen 64  scopeid 0x20<link>
        ether d0
:39:72:17:ea:ae  txqueuelen 1000  (Ethernet)
        RX packets
7335  bytes 663521 (647.9 KiB)
        RX errors
0  dropped 1751  overruns 0  frame 0
        TX packets
582  bytes 54176 (52.9 KiB)
        TX errors
0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt
174  
                                                                                       
lo
: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536                                            
        inet
127.0.0.1  netmask 255.0.0.0                                              
        inet6
::1  prefixlen 128  scopeid 0x10<host>                                    
        loop  txqueuelen
1  (Local Loopback)                                            
        RX packets
160  bytes 12960 (12.6 KiB)                                          
        RX errors
0  dropped 0  overruns 0  frame 0                                    
        TX packets
160  bytes 12960 (12.6 KiB)                                          
        TX errors
0  dropped 0 overruns 0  carrier 0  collisions 0                      
                                                                                       
usb0
: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500                                      
        inet
192.168.7.2  netmask 255.255.255.252  broadcast 192.168.7.3                
        ether d0
:39:72:17:ea:b0  txqueuelen 1000  (Ethernet)                            
        RX packets
0  bytes 0 (0.0 B)                                                  
        RX errors
0  dropped 0  overruns 0  frame 0                                    
        TX packets
0  bytes 0 (0.0 B)                                                  
        TX errors
0  dropped 0 overruns 0  carrier 0  collisions 0                      
                                                                                       
usb1
: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500                                      
        inet
192.168.6.2  netmask 255.255.255.252  broadcast 192.168.6.3                
        ether d0
:39:72:17:ea:b3  txqueuelen 1000  (Ethernet)                            
        RX packets
0  bytes 0 (0.0 B)                                                  
        RX errors
0  dropped 0  overruns 0  frame 0                                    
        TX packets
0  bytes 0 (0.0 B)                                                  
        TX errors
0  dropped 0 overruns 0  carrier 0  collisions 0                      
                                                                                       

2.  mysql is running: (another problem is setting up the time server on the BBB ;) )

root@beaglebone:~# systemctl status mysql                                              
mariadb.service - MariaDB database server                                            
   
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
   
Active: active (running) since Tue 2017-10-10 14:07:21 CEST; 4h 52min ago            
 
Process: 909 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITIO
 
Process: 900 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)    
 
Process: 598 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VA
 
Process: 573 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION
 
Process: 540 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld
 
Main PID: 812 (mysqld)                                                                
   
Status: "Taking your SQL requests now..."                                            
   
Tasks: 26 (limit: 4915)                                                            
   
CGroup: /system.slice/mariadb.service                                                
           
└─812 /usr/sbin/mysqld                                                      
                                                                                       
Oct 10 14:07:08 beaglebone systemd[1]: Starting MariaDB database server...              
Oct 10 14:07:16 beaglebone mysqld[812]: 2017-10-10 14:07:16 3064090624 [Note] /usr/sbin/
Oct 10 14:07:21 beaglebone systemd[1]: Started MariaDB database server.                


3.  I've googled for this, to no avail atm...

4.  I see no firewall rules at all:

root@beaglebone:~# iptables -L -n -v                                                    
Chain INPUT (policy ACCEPT 2959 packets, 304K bytes)                                    
 pkts bytes target     prot opt
in     out     source               destination        
                                                                                       
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)                                        
 pkts bytes target     prot opt
in     out     source               destination        
                                                                                       
Chain OUTPUT (policy ACCEPT 478 packets, 42627 bytes)                                  
 pkts bytes target     prot opt
in     out     source               destination        

5.  I will examine the logs now...

Thanks for your input.

Regards,
Paul.

Op donderdag 16 november 2017 12:54:26 UTC+1 schreef Tarmo Kuuse:

Paul Van den Bergh

unread,
Nov 16, 2017, 9:27:47 AM11/16/17
to BeagleBoard
My prevous post was shortened while posting....

4.  I see no firewall roules:


root@beaglebone:~# iptables -L -n -v                                                    
Chain INPUT (policy ACCEPT 2959 packets, 304K bytes)                                    
 pkts bytes target     prot opt
in     out     source               destination        
                                                                                       
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)                                        
 pkts bytes target     prot opt
in     out     source               destination        
                                                                                       
Chain OUTPUT (policy ACCEPT 478 packets, 42627 bytes)                                  
 pkts bytes target     prot opt
in     out     source               destination        

I'll examine the logs in the hope to find the problem.  Thanks for your valuable input !

Regards,
Paul


Op donderdag 16 november 2017 15:22:57 UTC+1 schreef Paul Van den Bergh:
                                           
   
Tasks: 26<span style="color: #000;" class=

Alex Bagehot

unread,
Nov 16, 2017, 10:10:43 AM11/16/17
to beagl...@googlegroups.com
Hi Paul,

Usually I stop the service that is being installed or has issues to remove it form the equation and test the network connectivity first.

stop mysql
install netcat if needed
run netcat listening on port 3306
  sudo nc -l 3306
check that it is indeed being listened on in another terminal:
  netstat -nat |grep LISTEN|grep 3306
or
  ss -nat |grep LISTEN|grep 3306

test connectivity locally first !!
  telnet ... blah
test connectivity remotely
   telnet ... blah

If you can connect locally but not remotely then there is some firewall/other network issue.
If you can connect remotely then your issue is in the service you originally wanted to test/ install

Googling though for "maria db 3306 connection refused" suggests another check: have you enabled remote access?
In your original email we don't see bind-address in your config or other remote access config.

thanks,
Alex


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/2460b837-a0af-49c3-be6e-87e827d0e58f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tarmo Kuuse

unread,
Nov 16, 2017, 10:14:17 AM11/16/17
to BeagleBoard
In this case you're probably looking at how MySQL comes configured by default on Debian - which seems to with remote access disabled, as Alex kindly pointed out. That would certainly explain your problems.

Dennis Lee Bieber

unread,
Nov 16, 2017, 10:50:20 AM11/16/17
to beagl...@googlegroups.com
On Thu, 16 Nov 2017 03:54:26 -0800 (PST), Tarmo Kuuse
<tarmo...@gmail.com> declaimed the
following:

>On Thursday, 16 November 2017 11:25:13 UTC+2, Paul Van den Bergh wrote:
>>
>> Same with telnet (from Debian in VirtualBox) :

Given that parenthetical, I'd add...

>Then you can proceed to further debugging your setup. Some suggestions:
>
>1. Verify that the IP you're connecting to is the IP of the Beaglebone
>("ifconfig" on BB)
>2. Verify that mysql service is running on the Beaglebone ("systemctl
>status mysql" on BB)
>3. Verify that mysql is accepting connections on port 3306 from external
>hosts (no idea, refer to the docs)
>4. Verify that there aren't any firewall rules to block traffic ("sudo
>iptables -L -n -v" on BB)
>5. Go through the mysql logs for any failures (/var/log/mysql.*)

Try plain telnet from the host OS, not from inside VirtualBox...

If the host OS is M$ Windows

C:\Users\Wulfraed>rem I don't have anything on this address

C:\Users\Wulfraed>telnet 192.168.2.3 3306
Connecting To 192.168.2.3...Could not open connection to the host, on port
3306: Connect failed

C:\Users\Wulfraed>

If telnet is not a valid command, one may need to use the "Turn Windows
features On or Off" and [X] Telnet Client to activate it (if Win10, one
might also want to make sure [X] Microsoft Print to PDF is selected too --
it is quite useful <G>)

Paul Van den Bergh

unread,
Nov 16, 2017, 11:28:51 AM11/16/17
to BeagleBoard
Same on native Windows :

C:\Users\VdBer>telnet 192.168.1.52 3306
Connecting To 192.168.1.52...Could not open connection to the host, on port 3306: Connect failed

C
:\Users\VdBer>

I think I'll try with another SD card with a fresh install.  The current one is in use for a longer period, and a lot of components are installed for testing/evaluating purposes.  Maybe that will help or make resolving less complicated....

Op donderdag 16 november 2017 16:50:20 UTC+1 schreef Dennis Lee Bieber:

Paul Van den Bergh

unread,
Nov 16, 2017, 1:29:10 PM11/16/17
to BeagleBoard
Finaly, I was able to connect to the MySql server on the remote Beaglebone :



However, I get this warning re compatibility of the server:



So, my next question is how to remove the installed version (installed by 'apt-get install mysql-server mysql-client' on the Beaglebone) and install the official MySQL distribution?

regards,
Paul
Op donderdag 16 november 2017 17:28:51 UTC+1 schreef Paul Van den Bergh:
Auto Generated Inline Image 1
Auto Generated Inline Image 2

Robert Nelson

unread,
Nov 16, 2017, 1:51:13 PM11/16/17
to Beagle Board, Paul Van den Bergh
On Thu, Nov 16, 2017 at 12:29 PM, Paul Van den Bergh <vdberg...@gmail.com> wrote:
Finaly, I was able to connect to the MySql server on the remote Beaglebone :



However, I get this warning re compatibility of the server:



So, my next question is how to remove the installed version (installed by 'apt-get install mysql-server mysql-client' on the Beaglebone) and install the official MySQL distribution?


You don't, well in Debian 9.x Stretch.


You downgrade to Debian 8.x Jessie, or build it yourself...

With Debian 9.x (stretch), the developers transitioned from MySQL -> MariaDB.  While "corporate" Oracle may not agree with that move, hence "their" tool see's it as incompatible. Most distro's have dropped MySQL like solid waste, and replaced it with MariaDB...

Regards,

--
Robert Nelson
https://rcn-ee.com/
Reply all
Reply to author
Forward
0 new messages