Tuesday, May 16, 2017

First steps with MongoDB - Windows

I am totally new here but, these are my very first steps with MongoDB


0. Download:

https://www.mongodb.com/download-center?jmp=nav

1. Install:

mongodb-win32-x86_64-2008plus-ssl-3.4.4-signed.msi

2. Start service:

D:\MongoDB\Server\3.4\bin>mongod.exe

Error:

MongoDB shell version v3.4.4
connecting to: mongodb://127.0.0.1:27017
I STORAGE  [initandlisten] exception in initAndListen: 29 Data directory D:\data\db\ not found., terminating

Solution:

Create folder: D:\data\db\

Ejecute mongo.exe


D:\MongoDB\Server\3.4\bin>mongo.exe
MongoDB shell version v3.4.4
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.4.4
Welcome to the MongoDB shell.
For interactive help, type "help".

Warning Message:

I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.

Solution: http://stackoverflow.com/questions/41615574/mongodb-server-has-startup-warnings-access-control-is-not-enabled-for-the-dat



Wednesday, May 3, 2017

MySQL MacOS: You must reset your password using ALTER USER statement before executing this statement.

If you get this message after install MySQL in MacOS:

You must reset your password using ALTER USER statement before executing this statement.

It is neccesary to reset the temporary password that was generated for root@localhost.

Open a session of Terminal:

Press "cmd + space" = Spotlight: type: Terminal

Type: the next statement, and type the emporary passwor, then alter (change) the password.

/usr/local/mysql/bin/mysql -uroot -p;
Enter password: 

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.7.18

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'NEWPASS';
Query OK, 0 rows affected (0.00 sec)

Lines up in red are the solution