I removed the code that shares the users and roles with the buddypress sub-site, so the wp-config.php and capabilities.php are back to the wordpress originals. Then I logged in with the admin account (the only user that was created when the wordpress was installed) and i managed to run the update wizard.
Then I changed the wp-config.php and capabilities.php files back to include the code used to share the users from my main wordpress site.