MySQL Tutorials - Herong's Tutorial Examples - v4.46, by Herong Yang
MySQL Data Directory Initialization
Tutorial example on how to initialize the MySQL server data directory with the 'mysqld --initialize-insecure' command, which will create a root user without password.
If you are installing MySQL Server using the Non-Install ZIP package, you need to initialize MySQL server data directory manually. Here is how I did it:
1. Make sure MySQL Server is installed in \local\mysql directory and there is no \local\mysql\data directory.
2. Run the MySQL data initialization command:
herong> \local\mysql\bin\mysqld --initialize-insecure
3. Check log file:
herong> type \local\mysql\data\localhost.err [System] [MY-013169] [Server] \local\mysql\bin\mysqld (mysqld 8.0.16) initializing of server in progress as process 8052 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option. [System] [MY-013170] [Server] \local\mysql\bin\mysqld (mysqld 8.0.16) initializing of server has completed
Warning message tells us that server data directory was created without a root password. This is because I used the "--initialize-insecure" option. No root password is fine for running a MySQL server on my local computer.
See next tutorial on how to create MySQL server service and start it.
Table of Contents
►MySQL Introduction and Installation
Downloading and Installing MySQL
Issues during MySQL Installation
Starting and Stopping MySQL Server
MySQL Command Line Client Tool
Using MySQL Non-Install Package
►MySQL Data Directory Initialization
Creating MySQL Windows Service
%mysql% Variable for MySQL Server Path
Introduction of MySQL Programs
Perl Programs and MySQL Servers
Java Programs and MySQL Servers
Character Strings and Bit Strings
Table Column Types for Different Types of Values
Using DDL to Create Tables and Indexes
Using DML to Insert, Update and Delete Records
Using SELECT to Query Database
Window Functions for Statistical Analysis
Use Index for Better Performance
Transaction Management and Isolation Levels
Defining and Calling Stored Procedures
Variables, Loops and Cursors Used in Stored Procedures
System, User-Defined and Stored Procedure Variables
Storage Engines in MySQL Server
InnoDB Storage Engine - Primary and Secondary Indexes
Performance Tuning and Optimization
Installing MySQL Server on Linux