TIMESTAMP with implicit DEFAULT value is deprecated

When setup MySQL using Docker, I got this warning messages.

2022-03-01 16:32:02+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.37-1debian10 started.
2022-03-01 16:32:03+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-03-01 16:32:03+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.37-1debian10 started.
2022-03-01 16:32:03+00:00 [Note] [Entrypoint]: Initializing database files
2022-03-01T16:32:03.363347Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2022-03-01T16:32:03.368810Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2022-03-01T16:32:03.368894Z 0 [ERROR] Aborting

As suggested in the logs above, the simple solution is you have to add explicit_defaults_for_timestamp=true into /etc/mysql/mysql.conf.d/mysqld.cnf on the [mysqld] section. Then restart your MySQL to take effect.
2022-03-01 19:21:03+00:00 [Note] [Entrypoint]: Starting temporary server
2022-03-01 19:21:03+00:00 [Note] [Entrypoint]: Waiting for server startup
2022-03-01T19:21:04.098887Z 0 [Note] mysqld (mysqld 5.7.37) starting as process 73 ...
2022-03-01T19:21:04.122680Z 0 [Note] InnoDB: PUNCH HOLE support available
2022-03-01T19:21:04.122817Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2022-03-01T19:21:04.122872Z 0 [Note] InnoDB: Uses event mutexes
2022-03-01T19:21:04.122885Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2022-03-01T19:21:04.122891Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-03-01T19:21:04.122897Z 0 [Note] InnoDB: Using Linux native AIO
2022-03-01T19:21:04.123252Z 0 [Note] InnoDB: Number of pools: 1
2022-03-01T19:21:04.123396Z 0 [Note] InnoDB: Using CPU crc32 instructions
2022-03-01T19:21:04.126063Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2022-03-01T19:21:04.141636Z 0 [Note] InnoDB: Completed initialization of buffer pool
2022-03-01T19:21:04.144961Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().

Reference:
https://stackoverflow.com/questions/15701636/how-to-enable-explicit-defaults-for-timestamp

ERROR MySQL: Can't connect to local MySQL server through socket

Currently I used OpenSUSE as my operating system, so to fix the issue as the title of this post is I'll modified the MySQL config at /etc/my.cnf. Open up the my.cnf config and go find the [client] section and uncomment these 2 lines below:

# port       = 3306
# socket     = /run/mysql/mysql.sock

Don't forget to change mode the my.cnf config file to 600, so just only you can edit it.
# chmod 600 my.cnf

To take effect, please restart mysql service.
# service mysql start

Now you can connect to mysql client by this command
# mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.2.15-MariaDB openSUSE package

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

Let say you haven't set the root password yet, you could reset/set a new root password with this following step below.
MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)

MariaDB [(none)]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

MariaDB [mysql]> show tables;
+---------------------------+
| Tables_in_mysql           |
+---------------------------+
-----------SNIP--------------
| user                      |
+---------------------------+
30 rows in set (0.00 sec)

Now set a new root password
MariaDB [mysql]> update user set password=PASSWORD("YOUR_NEW_PASSWORD") where User='root';

Query OK, 4 rows affected (0.00 sec)
Rows matched: 4  Changed: 4  Warnings: 0

And then tells MySQL to put the new changes.
MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

After all steps above done, you can now test it to connect to MySQL client with password that you've created.
# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.2.15-MariaDB openSUSE package

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

That's all.