Initializing the Data Directory bin\mysqld --initialize --console bin\mysqld --initialize-insecure --console Note Data directory initialization might fail if required system libraries are missing. For example, you might see an error like this: If this happens, you must install the missing libraries manually or with your system’s package manager. Then retry the data directory initialization command. bin/mysqld: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory It might be necessary to specify other options such as  --basedir  or  --datadir  if  mysqld  cannot identify the correct locations for the installation directory or data directory. For example (enter the command on a single line): bin/mysqld --initialize --user=mysql --basedir=/opt/mysql/mysql --datadir=/opt/mysql/mysql/data Alternatively, put the relevant option settings in an option file and pass the name of that file to  mysqld . For Unix and Unix-like systems, suppose that the option file name is  /opt/mysql/mysql/etc/my.cnf . Put these lines in the file: [mysqld] basedir=/opt/mysql/mysql datadir=/opt/mysql/mysql/data bin/mysqld --defaults-file=/opt/mysql/mysql/etc/my.cnf --initialize --user=mysql [mysqld] basedir=C:\\Program Files\\MySQL\\MySQL Server 8.0 datadir=D:\\MySQLdata bin\mysqld --defaults-file=C:\my.ini --initialize --console Then invoke  mysqld  as follows (enter the command on a single line with the  --defaults-file  option first): On Windows, suppose that  C:\my.ini  contains these lines: Then invoke  mysqld  as follows (enter the command on a single line with the  --defaults-file  option first): The data directory initialization sequence performed by the server does not substitute for the actions performed by  mysql_secure_installation  and mysql_ssl_rsa_setup . See Section 4.4.2, “mysql_secure_installation — Improve MySQL Installation Security” , and Section 4.4.3, “mysql_ssl_rsa_setup — Create SSL/RSA Files” . When invoked with the  --initialize  or  --initialize-insecure  option,  mysqld  performs the following actions during the data directory initialization sequence: Server Actions During Data Directory Initialization Note 251