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.
- Check if the
mysql
is running, in this repo, the basic code runs atlocalhost: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
'splugin
is set tocaching_sha2_password
, update tomysql_native_password
- Lastly, check
conf.json
file if it is updated properly
- in MacOS
netstat -anv | grep LISTEN
brew services
then check if the MySQL
is running, just stop and restart
mysql.server stop
mysql.server start
after all, check network again
- 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;
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)
- stop the Mysql
- get-in with non-login mode
then use non-password mode
mysqld_safe --skip-grant-tables &
mysql -u root
- Make existing password to
null
UPDATE USER SET authentication_string=null WHERE User='root';
FLUSH PRIVILEGES;
exit;
- Set new password
mysql -u root
USE USER;
set same password withALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'NEW_PASSWORD!';
conf.json
Version • Summary • Requirements • Usage
- mobius-2.4.36
- nCube-thyme-2.3.2
- MySQL
- Eclipse Mosquitto
- Node.js
mobius 1.1 version is only avaiable for tas_sample(led, co2)
now working on SMART RADAR SENSOR
- Clone this repository
$ git clone https://github.com/seunghwanly/mobius-docker.git
- Change directory to mobius
$ cd mobius
- Get dependencies
$ npm install
- 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"
}
- 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
- Check MySQL running
$ mysql.server start
- Run concurrently : mobius, nCube, mosquitto
$ npm run dev
ip : localhost
port : 3105
interval : 0(no use) and other