MySQL 8.0.39
Source Code Documentation
|
#include "sql/sql_initialize.h"
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "m_ctype.h"
#include "my_dir.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_loglevel.h"
#include "my_rnd.h"
#include "my_sys.h"
#include "mysql/components/services/log_builtins.h"
#include "mysqld_error.h"
#include "scripts/sql_commands_help_data.h"
#include "scripts/sql_commands_system_data.h"
#include "scripts/sql_commands_system_tables.h"
#include "scripts/sql_commands_system_users.h"
#include "scripts/sys_schema/sql_commands.h"
#include "sql/mysqld.h"
#include "sql/server_component/log_builtins_filter_imp.h"
#include "sql/sql_bootstrap.h"
Macros | |
#define | INSERT_USER_CMD "CREATE USER root@localhost IDENTIFIED BY '%s' PASSWORD EXPIRE;\n" |
#define | INSERT_USER_CMD_INSECURE "CREATE USER root@localhost;\n" |
#define | GENERATED_PASSWORD_LENGTH 12 |
#define | rnd_of(x) x[((int)(my_rnd_ssl(&failed) * 100)) % (sizeof(x) - 1)] |
Functions | |
bool | generate_password (char *password, int size) |
bool | initialize_create_data_directory (const char *data_home) |
Create the data directory. More... | |
Variables | |
static const char * | initialization_cmds [] = {"USE mysql;\n", nullptr} |
char | insert_user_buffer [sizeof(INSERT_USER_CMD)+GENERATED_PASSWORD_LENGTH *2] |
bool | opt_initialize_insecure = false |
bool | mysql_initialize_directory_freshly_created = false |
True if –initialize has actually created the directory. More... | |
static const char * | initialization_data [] |
static const char ** | cmds [] |
static const char * | cmd_descs [] |
keep in sync with the above array More... | |
#define GENERATED_PASSWORD_LENGTH 12 |
#define rnd_of | ( | x | ) | x[((int)(my_rnd_ssl(&failed) * 100)) % (sizeof(x) - 1)] |
bool generate_password | ( | char * | password, |
int | size | ||
) |
bool initialize_create_data_directory | ( | const char * | data_home | ) |
Create the data directory.
Creates the data directory when –initialize is specified. The directory is created when it does not exist. If it exists, is empty and the process can write into it no action is taken and the directory is accepted. Otherwise an error is thrown.
data_home | the normalized path to the data directory |
true | failed to create. Error printed. |
false | success |
|
static |
keep in sync with the above array
|
static |
|
static |
char insert_user_buffer[sizeof(INSERT_USER_CMD)+GENERATED_PASSWORD_LENGTH *2] |
bool mysql_initialize_directory_freshly_created = false |
True if –initialize has actually created the directory.
bool opt_initialize_insecure = false |