mysql 初始化问题

1、mysql_install_db初始化

[root@test3 bin]# ./mysql_install_db --user=mysql --basedir=/home/dpan/soft/mysql/mysql --datadir=/home/dpan/soft/mysql/data/
2021-05-14 15:32:04 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2021-05-14 15:32:09 [WARNING] The bootstrap log isn't empty:
2021-05-14 15:32:09 [WARNING] 2021-05-14T07:32:04.892924Z 0 [Warning] --bootstrap is deprecated. Please consider using --initialize instead

mysql_install_db 命令已经是弃用的,建议切换到mysqld –initialize命令

mysql_install_db会把密码生成在/root/.mysql_secret

2、mysqld初始化

./mysqld --initialize --user=mysql --basedir=/home/dpan/soft/mysql/mysql --datadir=/home/dpan/soft/mysql/data/

这种方式会将初始密码显示出来,妥善保管