`
sillycat
  • 浏览: 2542819 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

Docker and RaspberryPi 2017 - Docker NodeJS MariaDB

 
阅读更多
Docker and RaspberryPi 2017 - Docker NodeJS MariaDB

I download and install the latest version.

Install Docker
>curl -s https://packagecloud.io/install/repositories/Hypriot/Schatzkiste/script.deb.sh | sudo bash
>sudo apt-get install docker-hypriot=1.11.1-1

This does not work.

Find the deb package from here https://blog.hypriot.com/downloads/
download and have this file on raspberryPi docker-hypriot_1.11.1-1_armhf.deb
>sudo dpkg -i docker-hypriot_1.11.1-1_armhf.deb

>sudo usermod -aG docker carl
>sudo systemctl enable docker.service

Install NodeJS on RaspberryPi
My current raspberryPi is the old one I think. It is v6.
uname -a
Linux raspberrypi2 4.9.41+ #1023 Tue Aug 8 15:47:12 BST 2017 armv6l GNU/Linux
wget https://nodejs.org/dist/v8.5.0/node-v8.5.0-linux-armv6l.tar.gz
Directly unzip the file and add it the class path.

>node --version && npm --version
v8.5.0
5.3.0

>python -V
Python 2.7.13

Install MySQL Database
>sudo apt-get install mysql-server
>sudo apt-get install mysql-client

I do not know the root password, I try to reset that.
>sudo service mysql stop
>sudo mysqld_safe --skip-grant-tables

>mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 10.1.23-MariaDB-9+deb9u1 Raspbian 9.0

>use mysql;
>update user set authentication_string=password(‘xxxxxx') where user='root';
>sudo service mysql start

Not working, try again
>mysql --version
mysql  Ver 15.1 Distrib 10.1.23-MariaDB, for debian-linux-gnueabihf (armv7l) using readline 5.2
>sudo systemctl stop mariadb
>mysql -u root
>use mysql
>update user set password=password('kaishi') where user = 'root';
>FLUSH PRIVILEGES;

Kill the old services and start the new one
>sudo systemctl start mariadb

This one Worked
http://ikasten.io/2017/01/08/whats-the-default-password-of-root-user-in-mariadb/
> sudo mysql_secure_installation
>sudo mysql -u root
>create database pricemonitor;
>GRANT ALL ON pricemonitor.* TO pricemonitor@localhost IDENTIFIED BY ‘xxxxxx';

Then this works
>mysql -u pricemonitor -h localhost -p

Local login is fine, set up remote login
https://mariadb.com/kb/en/library/configuring-mariadb-for-remote-client-access/

>sudo vi /etc/mysql/mariadb.conf.d/50-server.cnf
#bind-address 127.0.0.1

Stop the DB
>sudo systemctl stop mariadb

Start the DB
>sudo systemctl start mariadb



References:
https://blog.hypriot.com/downloads/
http://raspberrywebserver.com/sql-databases/using-mysql-on-a-raspberry-pi.html
https://stackoverflow.com/questions/10895163/how-to-find-out-the-mysql-root-password
https://www.digitalocean.com/community/tutorials/how-to-reset-your-mysql-or-mariadb-root-password


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics