accidently locked myself out from roles...
OrientDB Version, operating system, or hardware.
- v2.2.5
Operating System
- Linux
Expected behavior and actual behavior
Grr, while experimenting, I accidently did the following command in the console:
orientdb> update ouser set roles = (SELECT FROM ORole WHERE name = 'voipadm')
(where this role 'voipadm' is a new one I was trying to setup) Now we are locked out from our database because all roles have been reset...
-> is there any way to recover the roles, without trashing my database contents ?
If you use the server, you can access to the database with the server's credential (root).
hey Luca, thx for your reply. I can indeed access the server (UNIX level) with UNIX credentials, and I can launch the console.sh, but from there is there any way I can reset the roles so that we can access the database again ?
All you did was overwrite the role names of the users, right? If you can open a console, couldn't you run a couple of queries to reenter the correct roles under the default users?
Scott
@rdelangh I meant OrientDB Server root credentials.
@lvca no, server root credentials are not accepted when I try to connect to that database
When you have installed the OrientDB Server, the first run it asks for the root password, right? To enter in the database (installed under the server "databases" directory) use "root" as user and the password you typed.
@lvca yes indeed, that it exactly the password that I tried with user "root" to access this dbase, but not possible anymore.
The server credentials bypass the database one. What's the error?
root@thishost:~# /opt/orientdb/orientdb-community-2.2.5/bin/console.sh
OrientDB console v.2.2.5 (build 2.2.x@r393af9c5a3e4a4408440a9376283a26d2d3d3c7b; 2016-07-20 06:03:46+0000) www.orientdb.com Type 'help' to display all the supported commands. Installing extensions for GREMLIN language v.2.6.0
orientdb> connect remote:localhost/mydbase root rootpwd
Connecting to database [remote:localhost/mydbase] with user 'root'... Error: com.orientechnologies.orient.core.exception.OSecurityAccessException: User or password not valid for database: 'mydbase' DB name="mydbase" DB name="mydbase"
orientdb>
It looks like the password is not correct. Try to reset it: http://orientdb.com/docs/last/Server-Security.html.
@lvca Luca, sorry if I misunderstand that documentation, but it describes how to recover the 'admin' user for a database, using the 'root' user connected to this same database. But the issue I encounter is that the 'root' user itself can not longer connect to the database (see my previous post above).
If you open the config/orientdb-server-config.xml file and remove the root user and the tag <isAfterFirstTime>true</isAfterFirstTime> at the end, on next restart of the server, a new root password is asked again. Use a password you can remember and than connect to the database with user = root and password = your password.
ok Luca, that worked, thanks ! Now I can connect again to this database with user 'root', and also with the 'admin' user again. Case closed, many thanks for your help !!
Cool.