Problems installing MySQL on Beaglebone black Debian 8

661 views
Skip to first unread message

robert...@hotmail.com

unread,
Jul 18, 2017, 3:43:15 PM7/18/17
to BeagleBoard

I try to install MySQL database on my begalebone black but didn't succed, seemed to have my disk full, solved that problem and try to install again but now I got the following error:

Then I run the commands suggested I got the following outputs:


I've tried to stop and start the mysql.service but is not working. I would really aprecciate if you could help me. Thanks

Robert Nelson

unread,
Jul 18, 2017, 3:54:55 PM7/18/17
to Beagle Board, robert...@hotmail.com
On Tue, Jul 18, 2017 at 1:30 PM, <robert...@hotmail.com> wrote:

I try to install MySQL database on my begalebone black but didn't succed, seemed to have my disk full, solved that problem and try to install again but now I got the following error:


Did you start with a fresh install? or did you just run the "grow_partition.sh" script?

Just installed it on my test {2016-05-13} image and it works:

debian@beaglebone:~$ systemctl status mysql.service 
● mysql.service - LSB: Start and stop the mysql database server daemon
   Loaded: loaded (/etc/init.d/mysql; generated; vendor preset: enabled)
   Active: active (running) since Tue 2017-07-18 19:50:22 UTC; 21s ago
     Docs: man:systemd-sysv-generator(8)
   CGroup: /system.slice/mysql.service
           ├─3859 /bin/sh /usr/bin/mysqld_safe
           └─4214 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plu

Jul 18 19:50:16 beaglebone systemd[1]: Starting LSB: Start and stop the mysql da
Jul 18 19:50:22 beaglebone mysql[3830]: Starting MySQL database server: mysqld .
Jul 18 19:50:22 beaglebone mysql[3830]: Checking for tables which need an upgrad
Jul 18 19:50:22 beaglebone mysql[3830]: not closed cleanly..
Jul 18 19:50:22 beaglebone systemd[1]: Started LSB: Start and stop the mysql dat
Jul 18 19:50:22 beaglebone /etc/mysql/debian-start[4281]: Upgrading MySQL tables
Jul 18 19:50:28 beaglebone /etc/mysql/debian-start[4286]: /usr/bin/mysql_upgrade
Jul 18 19:50:28 beaglebone /etc/mysql/debian-start[4347]: Triggering myisam-reco


debian@beaglebone:~$ sudo /opt/scripts/tools/version.sh 
git:/opt/scripts/:[a6e52fdbb7f0d94c04f3973725a85fc4d99a7858]
eeprom:[A335BNLTGW1ABBGW16051002]
dogtag:[BeagleBoard.org Debian Image 2016-05-13]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2016.03-00001-gd12d09f]
kernel:[4.9.38-ti-r48]
nodejs:[v0.12.18]
pkg:[bb-cape-overlays]:[4.4.20170630.1-0rcnee0~jessie+20170630]
pkg:[bb-wl18xx-firmware]:[1.20170718-0rcnee0~jessie+20170718]
pkg:[firmware-ti-connectivity]:[20161130-3]


It's my guess, one of mysql packages didn't fully install before you ran out of space.. but it got marked as installed...

try this first:

sudo apt update
sudo apt install mysql-server mysql-client --reinstall

otherwise start with a fresh image. 

Regards,

--
Robert Nelson
https://rcn-ee.com/

robert...@hotmail.com

unread,
Jul 19, 2017, 12:21:39 AM7/19/17
to BeagleBoard, robert...@hotmail.com
I did the update and then an upgrade. The upgrade tried to reinstall mysql but got an error in the password setting step, this one:

And the concerning info about it in the mentioned file would be this:

root@beaglebone:/usr/share/doc/mysql-server-5.5# zcat /usr/share/doc/mysql-server-5.5/README.Debian.gz
* MYSQL WON'T START OR STOP?:
=============================
You may never ever delete the special mysql user "debian-sys-maint". This
user together with the credentials in /etc/mysql/debian.cnf are used by the
init scripts to stop the server as they would require knowledge of the mysql
root users password else.
So in most of the times you can fix the situation by making sure that the
debian.cnf file contains the right password, e.g. by setting a new one
(remember to do a "flush privileges" then).

* PASSWORDS:
============
It is strongly recommended to set a password for the mysql root user (which
  /usr/bin/mysql -u root -D mysql -e "update user set password=password('new-password') where user='root'"
  /usr/bin/mysql -u root -e "flush privileges"
If you already had a password set add "-p" before "-u" to the lines above.


If you are tired to type the password in every time or want to automate your
scripts you can store it in the file $HOME/.my.cnf. It should be chmod 0600
(-rw------- username username .my.cnf) to ensure that nobody else can read
it.  Every other configuration parameter can be stored there, too. You will
find an example below and more information in the MySQL manual in
/usr/share/doc/mysql-doc or www.mysql.com.

ATTENTION: It is necessary, that a .my.cnf from root always contains a "user"
line wherever there is a "password" line, else, the Debian maintenance
scripts, that use /etc/mysql/debian.cnf, will use the username
"debian-sys-maint" but the password that is in root's .my.cnf. Also note,
that every change you make in the /root/.my.cnf will affect the mysql cron
script, too.

        # an example of $HOME/.my.cnf
        [client]
        user            = your-mysql-username
        password        = enter-your-good-new-password-here

I'm newbie at this so before procceding I'd like some guidance on how to do this line /usr/bin/mysql -u root -D mysql -e "update user set password=password('new-password') where user='root'" and what implies the "flush privileges"

Robert Nelson

unread,
Jul 19, 2017, 10:14:16 AM7/19/17
to Beagle Board, Rober Cordova
yeah, just reflash.. Your partition is corrupted from the failed install when you ran out of space..

Regards,

robert...@hotmail.com

unread,
Jul 20, 2017, 7:44:23 PM7/20/17
to BeagleBoard, robert...@hotmail.com
Ok. So I just reflash the BBB, should I do the partition first? and then install the myqsl database afterwards?.Last time I did the partition fllowing this guide: https://www.element14.com/community/community/designcenter/single-board-computers/next-gen_beaglebone/blog/2017/07/17/extending-micro-sd-card-space-for-beaglebone-black-use-windows-users

Thanks.
Reply all
Reply to author
Forward
0 new messages