All the passwords for the various modules are listed in the below file:
/opt/opsview/deploy/etc/user_secrets.yml
To get the root MySQL password:
[root@ovmon ~]# grep database_root_password /opt/opsview/deploy/etc/user_secrets.yml | awk '{print $2}' TWC7268txGQL6ct1nTJOhauE
You should now be able to login to MySQL as follows:
[root@ovmon ~]# mysql -u root -h localhost -p'TWC7268txGQL6ct1nTJOhauE' Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 2864 Server version: 5.5.64-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>
To avoid having to remember the password, you can create a ~/.my.cnf
file as follows:
[root@ovmon ~]# vim .my.cnf
Enter the following information replacing the password with your own:
[client] user=root password=TWC7268txGQL6ct1nTJOhauE
You should now be able to access MySQL as the root user simply by running mysql
:
[root@ovmon ~]# mysql Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 2992 Server version: 5.5.64-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>
If you want a database pre-selected by default, include the database
option:
[root@ovmon ~]# cat .my.cnf [client] user=root password=TWC7268txGQL6ct1nTJOhauE database=opsview
The opsview
database should now be selected by default:
[root@ovmon ~]# mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 3083 Server version: 5.5.64-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [opsview]>
Be the first to comment