Skip to content

Instantly share code, notes, and snippets.

@aldibier
aldibier / How to add a user to www-data (Ubuntu)
Last active November 24, 2022 13:06
How to add a user to www-data (Ubuntu)
Add a new user to the www-data group
In this example, add a new user called vivek to the www-data group, enter:
sudo useradd -g www-data vivek
### set the password for vivek user ###
sudo passwd vivek
@aldibier
aldibier / How to Create a New User and Grant Permissions in MySQL
Last active December 19, 2015 12:59
How to Create a New User and Grant Permissions in MySQL
How to Create a New User
Let’s start by making a new user within the MySQL shell:
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
Sadly, at this point newuser has no permissions to do anything with the databases. In fact, if newuser even tries to login (with the password, password), they will not be able to reach the MySQL shell.
Therefore, the first thing to do is to provide the user with access to the information they will need.
@aldibier
aldibier / MySQL Root Password Recover
Last active August 17, 2017 18:03
MySQL Root Password Recover
MySQL - Resetting a lost MySQL root password
Article ID: 405 Last updated on August 31, 2012 Authored by: Rackspace Support
The MySQL root password allows full access to the MySQL database and allows for all actions to be undertaken including creating new users, new databases, setting access rules and so on.
Losing one can be a difficult issue to encounter. Luckily, resetting the root password is easy as long as you have sudo access to the Server.
Contents
1 Not the Server root user