You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
By clicking “Sign up for GitHub”, you agree to our
terms of service
and
privacy statement
. We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
生成的初始化临时sql脚本(设置root密码和权限)没有执行,
entrypoint.sh
:
/usr/bin/mysqld --user=root --bootstrap --verbose=0 < $tfile
如上执行后, 数据库没有任何修改
https://dev.mysql.com/doc/refman/5.7/en/server-options.html
If the server is started with any of the --bootstrap, --initialize, or --initialize-insecure options, it operates in bootstap mode and some functionality is unavailable that limits the statements permitted in the file. These include statements that relate to account management (such as CREATE USER or GRANT), replication, and global transaction identifiers. See Section 18.1.3, “Replication with Global Transaction Identifiers”.
--bootstrap 和初始化文件会有一定冲突, 初始化文件里将不能执行grant和create user等命令.
正确的代码为:
/usr/bin/mysqld --init-file=$tfile --user=root --verbose=0