Skip to Main Content

MySQL Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Cannot start mysql with --skip-grant-tables argument

3720642Dec 27 2018 — edited Jan 2 2019

I've recently had to reinstall mysql server and, for some reason, there was no prompt to set a root password. Also, running dpkg-reconfigure mysql-community-server (and client) doesn't bring any prompts. The old password I used doesn't work, nor does a variety of different passwords, nor leaving the password blank.

So, I've looked around for a way to reset the root password and found that you need to stop the service, then start it with the arguments --skip-grant-tables --skip-networking, or --initialize-insecure (https://dev.mysql.com/doc/refman/8.0/en/data-directory-initialization-mysqld.html)

The problem is that, whenever I try either, it fails with the following error message:

2018-12-27T13:57:43.343621Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.13) starting as process 67033

2018-12-27T13:57:43.346792Z 0 [ERROR] [MY-010123] [Server] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

2018-12-27T13:57:43.346863Z 0 [ERROR] [MY-010119] [Server] Aborting

2018-12-27T13:57:43.347038Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.13)  MySQL Community Server - GPL.

root@host:/# mysql

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Of course, simply pointing to the Security section doesn't help at all. What, exactly, do I have to do to make the command (mysqld --skip-grant-tables --skip-networking OR --initialize-insecure) run with those arguments and not fail?

Running on Debian 9

This post has been answered by 3720642 on Jan 2 2019
Jump to Answer
Comments
Post Details
Added on Dec 27 2018
5 comments
6,016 views