-
mongorestore: ERROR: root directory must be a dump of a single collection when specifying a collection name with –collection
mongorestore wants the specific collection's filename rather than the entire database's dump folder:
dwiel@dwiel$ mongodump -d db -c variables -o ../backups/1
connected to: 127.0.0.1
DATABASE: db to ../backups/1/db
db.variables to ../backups/1/db/variables.bson
3 objects
dwiel@dwiel$ mongorestore -d db -c variables --drop ../backups/1
ERROR: root directory must be a dump of a single collection
when specifying a collection name with --collection
usage: ........
dwiel@dwiel$ mongorestore -d db -c variables --drop ../backups/1/db/variables.bson
connected to: 127.0.0.1
../backups/1/db/variables.bson
going into namespace [db.variables]
dropping
3 objectsquite obvious in retrospect given the error message, but the internet didn't know the answer yet and there isn't much documentation about mongorestore.
-
MySQL Permission Errors After Moving Datadir
I wanted to make space on my root partition and so moved my mysql data dir to /home/mysql in /etc/mysql/my.conf and received the following errors:
dwiel@dwiel:~$ sudo mysqld
091111 20:39:16 [Warning] Can't create test file /home/mysql/dwiel.lower-test
091111 20:39:16 [Warning] Can't create test file /home/mysql/dwiel.lower-test
091111 20:39:16 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
091111 20:39:16 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
091111 20:39:16 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
The problem was with apparmor. It was restricting mysql from reading and writing to /home/mysql. To correct this I edited the file /etc/apparmor.d/usr.sbin.mysqld and added:
/home/mysql r,
/home/mysql** rwk,
to the end of the file. Then restarted apparmor:
sudo /etc/init.d/apparmor restart
and then restarted apache with no problem
-
Passwordless login for SSH not working
I have not been able to login to my system with passwordless SSH for some time now and finally figured out the problem. I had to change the permissions of my home directory to disallow writing by everyone. I knew that ~/.ssh and the files in it required specific permissions to be set, but I hadn't heard about the home directory having similar requirements.
