The moodledata folder is NOT the moodle installation folder so when you deleted the cache folder, you actually deleted part of the code that runs moodle. The moodledata folder is a separate folder that you should have created during setup. It should NOT be in your moodle folder.
At this point, you need to reinstall moodle, find your moodledata folder, and delete the cache folder within it. Or, if you have the original folder that you installed moodle from, copy the cache folder from it over to your installation. Check that permissions and ownership are correct on that folder after copying.