Connect to mysql server without sudo

Only the root user needs sudo requirement to login to mysql. I resolved this by creating a new user and granting access to the required databases: CREATE USER ‘newuser’@’localhost’ IDENTIFIED BY ‘password’; GRANT ALL PRIVILEGES ON database_name.* TO ‘newuser’@’localhost’; now newuser can login without sudo requirement: mysql -u newuser -p

make git clone with sudo

When you run git using sudo, git will run as root. Because git is running as root, ssh is running as root. Because ssh is running as root, it is trying to log on to the remote server as root. The remote server is not okay with this (as it should be!) You will need … Read more

RVM and thin, root vs. local user

RVM comes with a handy wrapper generator that creates an intermediary loader for an init.d script. This allows you to load a service using a particular Ruby version and gemset. I use it like this (after installing the thin gem): 1 – create init.d entry for thin sudo thin install 2 – set up some … Read more

Composer: file_put_contents(./composer.json): failed to open stream: Permission denied

I had this problem to install laravel/lumen. It can be resolved with the following command: $ sudo chown -R “$(id -un)” “$(composer config –global home)” What this command does: Execute as privileged user (root) the command to change file owner (not group) to the current user (by name) recursively to the COMPOSER_HOME directory. As the … Read more

Root user/sudo equivalent in Cygwin?

I answered this question on SuperUser but only after the OP disregarded the unhelpful answer that was at the time the only answer to the question. Here is the proper way to elevate permissions in Cygwin, copied from my own answer on SuperUser: I found the answer on the Cygwin mailing list. To run command … Read more

npm command – sudo or not?

It’s possible (and advisable) to npm install -g node modules without sudo. Check the permission of your /usr/local/share/npm/bin folder. I had installed node and npm through brew (without sudo) and that particular folder ended up being owned by root. This fixed it for once and for all: $ sudo chown $(whoami) /usr/local/share/npm/bin (As for disallowing … Read more