May 6

How to Fix Adminer root@localhost login issue

So, after having successfully installed adminer, you can’t login. That happens and here is the simple fix:

Login to your mysql server as root:
[sourcecode language=”plain”]mysql -u root[/sourcecode]

Remove the root user:
[sourcecode language=”plain”]mysql> DROP USER ‘root’@’localhost’;
Query OK, 0 rows affected (0,00 sec)[/sourcecode]

Recreate the root user;
[sourcecode language=”plain”]mysql> CREATE USER ‘root’@’%’ IDENTIFIED BY ”;
Query OK, 0 rows affected (0,00 sec)[/sourcecode]

Grant permissions to your user:
[sourcecode language=”plain”]mysql> GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’ WITH GRANT OPTION;
Query OK, 0 rows affected (0,00 sec)[/sourcecode]

Flush privileges:
[sourcecode language=”plain”]mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0,01 sec)[/sourcecode]

You may now exit from the mysql console:
[sourcecode language=”plain”]mysql> exit;[/sourcecode]

solution originally posted from : AskUbuntu

April 19

Adding a user with sudo privileges in Ubuntu/Debian

When running a Ubuntu server, it less recommended to run things as root. The solution is to create a user with lesser privilege. To do so, we use the adduser command as shown below:

Step 1: SSH to your server as root and issue the command:

[sourcecode language=”plain”]adduser username[/sourcecode]

Step 2: Think of strong password and set as the new user’s password:

[sourcecode language=”plain”]
Set password prompts:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
[/sourcecode]
Step 3: Add the new user to the sudoers file:
[sourcecode language=”plain”]
usermod -aG sudo username
[/sourcecode]