Initializing the Data Directory This section describes how to initialize the data directory manually for MySQL installation methods for which data directory initialization is not automatic. For some suggested commands that enable testing whether the server is accessible and working properly, see Section 2.10.3, “Testing the Server” . In MySQL 8.0, the default authentication plugin has changed from mysql_native_password  to  caching_sha2_password , and the ’root’@’localhost’  administrative account uses  caching_sha2_password by default. If you prefer that the  root  account use the previous default authentication plugin ( mysql_native_password ), see caching_sha2_password and the root Administrative Account. In the examples shown here, the server is intended to run under the user ID of the  mysql  login account. Either create the account if it does not exist (see Create a mysql User and Group), or substitute the name of a different existing login account that you plan to use for running the server. Note •Data Directory Initialization Overview •Data Directory Initialization Procedure •Server Actions During Data Directory Initialization •Post-Initialization root Password Assignment Data Directory Initialization Overview 1. Change location to the top-level directory of your MySQL installation, which is typically  /usr/local/ mysql  (adjust the path name for your system as necessary): 2. The  secure_file_priv  system variable limits import and export operations to a specific directory. Create a directory whose location can be specified as the value of that variable: 3. Use the server to initialize the data directory, including the  mysql  schema containing the initial MySQL grant tables that determine how users are permitted to connect to the server. For example: Typically, data directory initialization need be done only after you first install MySQL. (For upgrades to an existing installation, perform the upgrade procedure instead; see Section 2.11, “Upgrading MySQL” .) However, the command that initializes the data directory does not overwrite any existing mysql  schema tables, so it is safe to run in any circumstances. For important information about the command, especially regarding command options you might use, see Data Directory Initialization Procedure. For details about how the server performs initialization, see Server Actions During Data Directory Initialization. Grant directory user and group ownership to the  mysql  user and  mysql  group, and set the directory permissions appropriately: Within this directory you can find several files and subdirectories, including the  bin  subdirectory that contains the server, as well as client and utility programs. 249 bin/mysqld --initialize --user=mysql chown mysql:mysql mysql-files chmod 750 mysql-files mkdir mysql-files cd /usr/local/mysql