hypriot / rpi-mysql Goto Github PK
View Code? Open in Web Editor NEWRPi-compatible Docker image with Mysql
License: MIT License
RPi-compatible Docker image with Mysql
License: MIT License
When installing this container on my raspberrypi, i get the following error:
docker: no matching manifest for linux/arm64/v8 in the manifest list entries.
uname -m
gives me the following output:
aarch64
I don't know a lot about docker or linux, but is the problem that my pi is on a 64 bit OS?
Whenever
db:
image: hypriot/rpi-mysql
ports:
- "32000:3306"
restart: always
environment:
- MYSQL_ROOT_PASSWORD=foo
- MYSQL_DATABASE=bar
- MYSQL_USER=demouser
- MYSQL_PASSWORD=demopassword
volumes:
- ./db/schema:/docker-entrypoint-initdb.d/:ro
Inside /db/schema
I have 1.sql
:
USE `bar`;
CREATE TABLE `Logs` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`user_message` varchar(50) CHARACTER SET utf8 NOT NULL DEFAULT '',
`message` text COLLATE utf8_bin,
`read` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
);
I receive the error:
ERROR: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
When I use the tobi312/rpi-mysql
image everything works as expected.
Inside the container when runnning:
$ cat /tmp/mysql-first-time.sql
I get:
DELETE FROM mysql.user ;
CREATE USER 'root'@'%' IDENTIFIED BY 'demopassword' ;
GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ;
DROP DATABASE IF EXISTS test ;
CREATE DATABASE IF NOT EXISTS `bar` ;
CREATE USER 'demouser'@'%' IDENTIFIED BY 'demopassword' ;
GRANT ALL ON `bar`.* TO 'demouser'@'%' ;
FLUSH PRIVILEGES ;
USE `bar`;
CREATE TABLE `Logs` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`user_message` varchar(50) CHARACTER SET utf8 NOT NULL DEFAULT '',
`message` text COLLATE utf8_bin,
`read` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
);
Which seems to have no syntax error other than the space?
I don't have any issue, but much more a question actually:
Is it possible to run armv7l binaries on a armv6l OS ?
Because this is what it looks like on rpi1 devices:
$ docker run -it --rm hypriot/rpi-mysql mysql --version
mysql Ver 14.14 Distrib 5.5.60, for debian-linux-gnu (armv7l) using readline 6.2
$ docker run -it --rm hypriot/rpi-mysql uname -a
Linux f2e6f925ce19 4.9.59+ #1047 Sun Oct 29 11:47:10 GMT 2017 armv6l GNU/Linux
I tried to modify the Dockerfile/Makefile to support 5.6. The build was successful, but it crashes soon after it starts:
# tail /var/log/mysql/error.log
2016-04-04 04:18:49 3152 [Note] InnoDB: Completed initialization of buffer pool
2016-04-04 04:18:49 3152 [Note] InnoDB: Highest supported file format is Barracuda.
2016-04-04 04:18:49 3152 [Note] InnoDB: 128 rollback segment(s) are active.
2016-04-04 04:18:49 3152 [Note] InnoDB: Waiting for purge to start
2016-04-04 04:18:49 3152 [Note] InnoDB: 5.6.28 started; log sequence number 1600637
2016-04-04 04:18:49 3152 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2016-04-04 04:18:49 3152 [Note] - '127.0.0.1' resolves to '127.0.0.1';
2016-04-04 04:18:49 3152 [Note] Server socket created on IP: '127.0.0.1'.
2016-04-04 04:18:49 3152 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
160404 04:18:49 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
Maybe you can give it a shot. I only had to add a new apt source to get 5.6 installed:
# cat /etc/apt/sources.list
deb http://archive.raspbian.org/raspbian wheezy main contrib non-free rpi firmware
deb http://http.us.debian.org/debian/ unstable non-free contrib main
Hi,
it seems like after todays commits / image rebuilds the container won't start. It currently crashes with the following log:
2018-06-16 14:28:45 1995644928 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2018-06-16 14:28:45 1995644928 [Note] InnoDB: The InnoDB memory heap is disabled
2018-06-16 14:28:45 1995644928 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-06-16 14:28:45 1995644928 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-06-16 14:28:45 1995644928 [Note] InnoDB: Compressed tables use zlib 1.2.8
2018-06-16 14:28:45 1995644928 [Note] InnoDB: Using Linux native AIO
2018-06-16 14:28:45 1995644928 [Note] InnoDB: Using generic crc32 instructions
2018-06-16 14:28:45 1995644928 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2018-06-16 14:28:45 1995644928 [Note] InnoDB: Completed initialization of buffer pool
2018-06-16 14:28:45 1995644928 [Note] InnoDB: Highest supported file format is Barracuda.
2018-06-16 14:28:46 1995644928 [Note] InnoDB: 128 rollback segment(s) are active.
2018-06-16 14:28:46 1995644928 [Note] InnoDB: Waiting for purge to start
2018-06-16 14:28:46 1995644928 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.35-80.0 started; log sequence number 30965811
2018-06-16 14:28:46 1430254400 [Note] InnoDB: Dumping buffer pool(s) not yet started
2018-06-16 14:28:46 1995644928 [Note] Plugin 'FEEDBACK' is disabled.
2018-06-16 14:28:46 1995644928 [Note] Server socket created on IP: '127.0.0.1'.
2018-06-16 14:28:46 1995644928 [ERROR] Can't start server : Bind on unix socket: No such file or directory
2018-06-16 14:28:46 1995644928 [ERROR] Do you already have another mysqld server running on socket: /var/run/mysqld/mysqld.sock ?
2018-06-16 14:28:46 1995644928 [ERROR] Aborting
I can replicate that problem on 2 different Pi's, started via docker run -ti -e MYSQL_ROOT_PASSWORD=test hypriot/rpi-mysql:latest
.
Any idea on how to fix this problem?
Like the official MySQL Docker Image this Images should be able to execute Files from within /docker-entrypoint-initdb.d/*
After apt-get update, apt-get dist-upgrade of the base Hypriot System on Raspi I receive an
EXEC format error.
db_1 | standard_init_linux.go:211: exec user process caused "exec format error"
Linux OpenHAB 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux
Docker version 19.03.4, build 9013bf5
Hi there,
I use a 4 node HypriotOS cluster and have a problem running running rpi-mysql as one service in docker-compose-yml.
The error message is: no suitable node (unsupported platform on 4 nodes)
According to my understand and checks the architecture cluster is armv7l, but the image used is amd64. Here is the corresponding output:
docker info:
Containers: 1
Running: 1
Paused: 0
Stopped: 0
Images: 2
Server Version: 18.05.0-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: active
NodeID: v8gvd8b8mj691a60zwqamqmsz
Is Manager: true
ClusterID: izjv51lqodr8grt7ak1g005pd
Managers: 1
Nodes: 4
Orchestration:
Task History Retention Limit: 5
Raft:
Snapshot Interval: 10000
Number of Old Snapshots to Retain: 0
Heartbeat Tick: 1
Election Tick: 10
Dispatcher:
Heartbeat Period: 5 seconds
CA Configuration:
Expiry Duration: 3 months
Force Rotate: 0
Autolock Managers: false
Root Rotation In Progress: false
Node Address: 192.168.3.1
Manager Addresses:
192.168.3.1:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 773c489c9c1b21a6d78b5c538cd395416ec50f88
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 4.14.34-hypriotos-v7+
Operating System: Raspbian GNU/Linux 9 (stretch)
OSType: linux
Architecture: armv7l
CPUs: 4
Total Memory: 976.7MiB
Name: hydra
ID: 6SGF:7I46:ZZWD:AWN5:TCVS:R37F:CIK7:5JOX:ACPQ:YI5H:IYHN:KIKT
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
docker service inspect openhab-suite_mysqldb:
[
{
"ID": "soqhiur1f612rsg7hwtf7ukw7",
"Version": {
"Index": 2211
},
"CreatedAt": "2018-06-16T01:41:43.341077286Z",
"UpdatedAt": "2018-06-16T01:41:43.348289301Z",
"Spec": {
"Name": "openhab-suite_mysqldb",
"Labels": {
"com.docker.stack.image": "hypriot/rpi-mysql",
"com.docker.stack.namespace": "openhab-suite"
},
"TaskTemplate": {
"ContainerSpec": {
"Image": "hypriot/rpi-mysql:latest@sha256:c1567c885cf560da66a647f91f7e16bfeea2968895f859b5732583a8db3570ea",
"Labels": {
"com.docker.stack.namespace": "openhab-suite"
},
"Env": [
"MYSQL_DATABASE=openhab2",
"MYSQL_PASSWORD=ignorethis",
"MYSQL_ROOT_PASSWORD=superignorethis",
"MYSQL_USER=someuser"
],
"Privileges": {
"CredentialSpec": null,
"SELinuxContext": null
},
"Mounts": [
{
"Type": "bind",
"Source": "/swarm/volumes/mysql/",
"Target": "/var/lib/mysql"
}
],
"StopGracePeriod": 10000000000,
"DNSConfig": {},
"Isolation": "default"
},
"Resources": {},
"RestartPolicy": {
"Condition": "any",
"Delay": 5000000000,
"MaxAttempts": 0
},
"Placement": {
"Platforms": [
{
"Architecture": "amd64",
"OS": "linux"
}
]
},
"Networks": [
{
"Target": "8lkdos19at3susum00dsofsbs",
"Aliases": [
"mysqldb"
]
}
],
"ForceUpdate": 0,
"Runtime": "container"
},
"Mode": {
"Replicated": {
"Replicas": 1
}
},
"UpdateConfig": {
"Parallelism": 1,
"FailureAction": "pause",
"Monitor": 5000000000,
"MaxFailureRatio": 0,
"Order": "stop-first"
},
"RollbackConfig": {
"Parallelism": 1,
"FailureAction": "pause",
"Monitor": 5000000000,
"MaxFailureRatio": 0,
"Order": "stop-first"
},
"EndpointSpec": {
"Mode": "vip",
"Ports": [
{
"Protocol": "tcp",
"TargetPort": 3306,
"PublishedPort": 3306,
"PublishMode": "ingress"
}
]
}
},
"Endpoint": {
"Spec": {
"Mode": "vip",
"Ports": [
{
"Protocol": "tcp",
"TargetPort": 3306,
"PublishedPort": 3306,
"PublishMode": "ingress"
}
]
},
"Ports": [
{
"Protocol": "tcp",
"TargetPort": 3306,
"PublishedPort": 3306,
"PublishMode": "ingress"
}
],
"VirtualIPs": [
{
"NetworkID": "ycxuvpuz55wn8li2g3pz7pvpy",
"Addr": "10.255.1.71/16"
},
{
"NetworkID": "8lkdos19at3susum00dsofsbs",
"Addr": "10.0.2.6/24"
}
]
}
}
]
and last the docker-compose.yml:
version: '3'
services:
# openhab:
# image: "openhab/openhab:2.2.0-armhf-debian"
# depends_on:
# - mysqldb
# - mosquitto
# restart: always
# ports:
# - "80:8080"
# - "443:8443"
# volumes:
# - /etc/localtime:/etc/localtime:ro
# - ./timezone:/etc/timezone:ro
# - /swarm/volumes/openhab/config:/openhab/conf
# - /swarm/volumes/openhab/persist:/openhab/userdata/persistence
# - /swarm/volumes/openhab/logs:/openhab/userdata/logs
# - ./backup:/backups
# networks:
# - openhab_net
mysqldb:
image: hypriot/rpi-mysql
volumes:
- /swarm/volumes/mysql/:/var/lib/mysql
ports:
- "3306:3306"
restart: always
environment:
MYSQL_ROOT_PASSWORD: "superignorethis"
MYSQL_DATABASE: openhab2
MYSQL_USER: someuser
MYSQL_PASSWORD: "ignorethis"
networks:
- openhab_net
mosquitto:
image: pascaldevink/rpi-mosquitto
restart: always
ports:
- "1883:1883"
- "9001:9001"
volumes:
- /swarm/volumes/mqtt/config:/mqtt/config:ro
- /swarm/volumes/mqtt/log:/mqtt/log
- /swarm/volumes/mqtt/data:/mqtt/data
networks:
- openhab_net
networks:
openhab_net:
BTW the mosquitto image works without a problem ...
Would really love to see updated releases of this container, namely a 5.7 container.
Hello,
I try to setup this container on a raspberry.
On Docker host, I have mount an NFS share to /mnt/swarmData/labemilie-db and I could write on it.
I try to start a container with this command line :
docker container create --name labemilie-db --hostname labemilie-db --network labemilie-network -v /mnt/swarmData/labemilie-db:/var/lib/mysql --env MYSQL_ROOT_PASSWORD=bestPassword hypriot/rpi-mysql:arm-5.5
But I got this error :
181118 17:18:47 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.,
181118 17:18:47 [Note] mysqld (mysqld 5.5.60-0+deb7u1) starting as process 1 ...,
181118 17:18:47 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.,
181118 17:18:47 [Note] Plugin 'FEDERATED' is disabled.,
�mysqld: Can't find file: './mysql/plugin.frm' (errno: 13),
181118 17:18:47 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.,
181118 17:18:47 InnoDB: The InnoDB memory heap is disabled,
181118 17:18:47 InnoDB: Mutexes and rw_locks use GCC atomic builtins,
181118 17:18:47 InnoDB: Compressed tables use zlib 1.2.7,
181118 17:18:47 InnoDB: Using Linux native AIO,
181118 17:18:47 InnoDB: Initializing buffer pool, size = 128.0M,
181118 17:18:47 InnoDB: Completed initialization of buffer pool,
181118 17:18:47 InnoDB: Operating system error number 13 in a file operation.,
InnoDB: The error means mysqld does not have the access rights to,
InnoDB: the directory.,
InnoDB: File name ./ibdata1,
InnoDB: File operation call: 'create'.,
InnoDB: Cannot continue operation.,
If I try to start the same container without the mounting of /var/lib/mysql, it's OK.
Could you help to solve this behaviour?
Thanks for your help.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.