This is the entire solution for your problem.
According to fromdual, the suggestion is to just follow the
advice of the error. Some functionality is being deprecated.
Our advice is to enable the variable explicit_defaults_for_timestamp
now on your testing systems so you can see if your application behave
well and then you are prepared for the next release when this feature
will become the default.
In short term this warning is NOT dangerous. In the long term you
have to be prepared for the deprecated functionality. You get rid of
the warning my setting explicit_defaults_for_timestamp = 1 in your
my.cnf [mysqld] section.
You can find the my.cnf file in the following locations, and in
this order the values override each other:
- /etc/my.cnf
- /etc/mysql/my.cnf
- $MYSQL_HOME/my.cnf
- [datadir]/my.cnf
- ~/.my.cnf
You can also find your file by
find / -name my.cnf
I added the following in /etc/mysql/my.cnf
[mysqld]
explicit_defaults_for_timestamp = 1
Now try
mysqld --initialize
And I got a reduced error without Timestamp stuff
mysqld: Can't create directory '/var/lib/mysql/' (Errcode: 17 - File exists)
2018-11-12T20:13:45.024116Z 0 [ERROR] Aborting
Is this good? Not sure so I look deeper. According to the aboveaccepted stack
answer for the error you need to
sudo -i #log into root
cd /var/lib/mysql
rm -r *
su username # get back to the original user
mysqld --initialize
This, still gave me the exact same error. No change!
mysqld: Can't create directory '/var/lib/mysql/' (Errcode: 17 - File exists)
2018-11-12T20:13:45.024116Z 0 [ERROR] Aborting
I am not sure the above accepted answer helped at all with the removing the
/var/lib/mysql, but sudo helped:
sudo mysqld --initialize
worked... No error at all!