All posts by Don Matteo

lebt in der Schweiz, ist System Engineer MCP bei A-Enterprise GmbH. Mitglied des UNBLOG Knowledge Network. Author und Blogger zu den Themen, Tutorials für Linux und Open Source.

Set MySQL root password to blank

How to set a blank MySQL root password

In some situations a blank mysql root password is useful, e.g. when providing tests, when multiple database schemes have to be imported, or simply when deploing sql databases are to be provided for tests.

mysql root password

In the terminal, first open MySQL with the root account.

$ sudo mysql

For some MySQL root password configurations, the following command may need to be execute with root password entry.

$ mysql -u root -p

If you need to set an empty password for the root user, this can be created with this command.

MariaDB> SET PASSWORD FOR 'root'@'localhost' = '';

If the password of an existing user is to be set to blank, the following ALTER USER command can be used.

MariaDB> ALTER USER 'user'@'localhost' IDENTIFIED BY '';

The following command creates a new user and will set a blank password.

MariaDB> CREATE USER 'user'@'localhost' IDENTIFIED BY '';

Alternatively, mysqladmin can be used to empty the root password.

$ sudo mysqladmin -u root -pcurrent_password password ''

Note. MySQL can also be managed easily and clearly in the phpMyAdmin graphical web interface.

Conclusion

In this post I show how to set a blank mysql root password can be useful in situations such as when deploying tests when multiple database schemes need to be imported, or simply when sql databases are to be deployed for testing in non-production environments where it should go for simplification without major hurdles.

Linux command tail -f on Windows in PowerShell

Linux tail is part of the GNU Core Utilities (Coreutils), the tail command is not included in Windows, but can use in PowerShell. It is a collection of basic command line commands that come with most Linux OS.

First and foremost, tail is used to output the end of a (text) file, or to restrict the output of a Linux command to a certain area. The tail command is related to the head command and the cat and less commands. These Linux commands all serve one purpose of outputting the contents of text files.

Linux tail with PowerShell on Windows

As used on Linux tail with the -f (–follow) option to follow the update of a log file in real time, but on Windows there is no tail command. For this Windows has the PowerShell command Get-Content, to track a log file followed in real time, new lines that are written to the log file can also be displayed continuously under Windows.

PowerShell Get-Content -Wait -Tail

On Windows, the Linux tail command does not exist. For this, Windows has the PowerShell command Get-Content, with the option -Wait -Tail a log file can be followed in real time. New lines that are written to the log file can also be displayed continuously under Windows.

PS C:\> Get-Content C:\inetpub\logs\LogFiles\W3SVC1\20230227.log -Wait -Tail 10

  The update is stopped when you click in the PowerShell window, the update stays in mark mode, the update is continued with hit Escape.

This example tracks the IIS log file in real time and outputs it to Windows 10 or Windows 11 PowerShell.

On Linux the equivalent command is tail -f and on Windows it would look like tail -f C:\inetpub\logs\LogFiles\W3SVC1\20230227.log