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

How do I run my application as superuser from Eclipse?

You can follow these steps to compile/debug applications as superuser. Rename your java-application sudo mv /usr/lib/jvm/java-6-openjdk/jre/bin/java /usr/lib/jvm/java-6-openjdk/jre/bin/java.ori Create following script and store it as /usr/lib/jvm/java-6-openjdk/jre/bin/java #!/bin/bash # file: /usr/lib/jvm/java-6-openjdk/jre/bin/java # descr: Starter for jdk. Runs jdk as root when # cmd-line-arg “–run-as-root” is specified. # jre=”/usr/lib/jvm/java-6-openjdk/jre/bin/java.ori” run_as_root=false args= # Filter command-line argument for arg in … Read more

What is the proper way to sudo over ssh?

Another way is to use the -t switch to ssh: ssh -t user@server “sudo script” See man ssh: -t Force pseudo-tty allocation. This can be used to execute arbi- trary screen-based programs on a remote machine, which can be very useful, e.g., when implementing menu services. Multiple -t options force tty allocation, even if ssh … Read more

sudo pip install VS pip install –user

$ sudo pip install Installs the package globally in your python installation, i.e. for all users. $ pip install –user Installs to the local user directory, i.e. ~/.local/lib/python — just you. Example: $ sudo pip install jupyter $ jupyter notebook Will run jupyter, open a web browser, allow you to work with notebooks. $ pip … Read more

On EC2: sudo node command not found, but node without sudo is ok

Yes, it is a bit annoying but you can fix it with some links: sudo ln -s /usr/local/bin/node /usr/bin/node sudo ln -s /usr/local/lib/node /usr/lib/node sudo ln -s /usr/local/bin/npm /usr/bin/npm sudo ln -s /usr/local/bin/node-waf /usr/bin/node-waf There might be more but that is all I have run across so far. Lack of node-waf will cause some npm … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)