Skip to content

seunghwanly/mobius-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💡 DB Connection Error

after getting clone from this repository, few might had issue with DB connection with below message.

[db.connect] No Connection

For simple issue, the problem would be the password is not able to create a connection pool through nodejs.

Checklist

  • Check if the mysql is running, in this repo, the basic code runs at localhost:3306
  • If you are using MacOS and using homebrew, don't be confused you might be using both daemon and mysql simultaneously
  • Check if the root's plugin is set to caching_sha2_password, update to mysql_native_password
  • Lastly, check conf.json file if it is updated properly

Check Network

  • in MacOS
netstat -anv | grep LISTEN

스크린샷 2022-01-16 오후 3 40 41

Check Homebrew(Daemon) and Mysql (only MacOS)

brew services

스크린샷 2022-01-16 오후 3 25 18

then check if the MySQL is running, just stop and restart

mysql.server stop
mysql.server start

after all, check network again

Check Mysql settings

  • use mysql database which is already created when you download MySQL
  • write command below in sequence
USE mysql;
SELECT User, Host, plugin FROM USER;

Expected result)

+------------------+-----------+-----------------------+
| User             | Host      | plugin                |
+------------------+-----------+-----------------------+
| mysql.infoschema | localhost | caching_sha2_password |
| mysql.session    | localhost | caching_sha2_password |
| mysql.sys        | localhost | caching_sha2_password |
| root             | localhost | caching_sha2_password |
+------------------+-----------+-----------------------+

Change caching_sha2_password to mysql_native_password

UPDATE USER SET plugin='mysql_native_password' WHERE User='root';
FLUSH PRIVILEGES;

Check the results 스크린샷 2022-01-16 오후 3 33 11

AFTER PROBLEM

when you tried to acces with mysql -u root -p and below message occurs, we need to reset the password of root.

Access denied for user 'root'@'localhost' (using password: YES)
  1. stop the Mysql
  2. get-in with non-login mode
    mysqld_safe --skip-grant-tables &
    then use non-password mode
    mysql -u root
  3. Make existing password to null
    UPDATE USER SET authentication_string=null WHERE User='root';
    FLUSH PRIVILEGES;
    exit;
  4. Set new password
    mysql -u root
    USE USER;
    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'NEW_PASSWORD!';
    set same password with conf.json

스크린샷 2022-01-16 오후 3 42 00


VersionSummaryRequirementsUsage


Version

  • mobius-2.4.36
  • nCube-thyme-2.3.2

Summary

Requirements

  • MySQL
  • Eclipse Mosquitto
  • Node.js

Usage

💡 Using docker Image

mobius 1.1 version is only avaiable for tas_sample(led, co2)
now working on SMART RADAR SENSOR

💡 Running the app locally

  1. Clone this repository
$ git clone https://github.com/seunghwanly/mobius-docker.git
  1. Change directory to mobius
$ cd mobius
  1. Get dependencies
$ npm install
  1. create conf.json file in mobius-2.4.36
{
    "csebase": "onem2m",
    "cseid": "/onem2m",
    "csebaseport": "7579",
    "csetype": "in",
    "dbhost": "localhost",
    "dbuser": "root",
    "dbpass": !MySQL PASSWORD!, 
    "dbname": "mobiusdb", 
    "superadm_usr": "superadmin",
    "superadm_pwd": "f7c6c12d",
    "pxymqttport": 7580,
    "pxycoapport": 5683,
    "pxywsport": 7577,
    "tsagentport": 7582,
    "mqttbroker": "localhost",
    "secure": "disable",
    "authorization": true,
    "logDir": "./log"  
 }
 
  1. import database mysqldb.sql
$ mysql -u root -p

create and import database

mysql> CREATE DATABASE mobiusdb;
mysql> USE mobiusdb;
mysql> SOURCE "path";   // mobius-2.4.36/mobius/mobiusdb.sql path
mysql> SHOW DATABASES;  // check database has created

simple import, if database already exist

$ mysql -u root -p mobiusdb < ~/mobius-2.4.36/mobius/mobiusdb.sql
  1. Check MySQL running
$ mysql.server start
  1. Run concurrently : mobius, nCube, mosquitto
$ npm run dev

💡 Radar Setting

ip : localhost
port : 3105
interval : 0(no use) and other

Guideline in KOREAN

See in Notion
See in velog

About

runs concurrently "mysql-mosquitto-mobius-nCube-tas"

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages