ORA-38706: Cannot turn on FLASHBACK DATABASE logging

SQL> alter database flashback on;
 alter database flashback on
 *
 ERROR at line 1:
 ORA-38706: Cannot turn on FLASHBACK DATABASE logging.
 ORA-38707: Media recovery is not enabled.

Cause : For enable flashback database must be archive mode. To resolve this error enable archive log mode.

SQL>SHUTDOWN IMMEDIATE;

SQL> STARTUP MOUNT;
ORACLE instance started.

Total System Global Area  630501376 bytes
Fixed Size                  2215984 bytes
Variable Size             381685712 bytes
Database Buffers          243269632 bytes
Redo Buffers                3330048 bytes
Database mounted.

SQL> archive log list;

Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /u01/app/oracle/oradata/archive
Oldest online log sequence     434
Current log sequence           436

SQL> alter database archivelog;
Database altered.

SQL> alter database flashback on;
Database altered.

SQL>alter database open;
database altered

SQL>select flashback_on from v$database;
FLASHBACK_ON
--------------------
ON

How to fix: ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)

Open your terminal and type mysql -u root -p Enter your password. Hopefully your MySQL is logged in now.