Been trying to defined vt users with passwords

133 views
Skip to first unread message

Scott Klasing

unread,
May 25, 2023, 9:30:05 PM5/25/23
to vitess

Currently using Vitess 15.x MySQL8.x.


I am attempting to replace the default init_db_sql_file where the Vitess id's actually have passwords.

  • I have used many variations on the below example based on other examples I have seen in this Vitess group.
  • I also noted this flag --init_db_sql_file is not shown as an option for mysqlctl but it is shown as an option for mysqlctld in the documentation.
  • Yet many of the examples in this email group show the same flag being used for mysqlctl, some with two dashes preceding, others with 1 dash.
  • I have also seen references online where vttablet-up invokes mysqlctld using the parameter.

So the first question is --init_db_sql_file a valid parameter for mysqlctl.

If it is, then can you steer me to the correct syntax usage.

If it is not can you steer me towards when and where to use --init_db_sql_file correctly.


My script code is:

#action="init"

init_db_sql="$VTCONFIG/init_db_vt.sql"

action="init --init_db_sql_file $init_db_sql"


if [ -d $VTDATAROOT/$tablet_dir ]; then

 echo "Resuming from existing vttablet dir:"

 echo "    $VTDATAROOT/$tablet_dir"

 action='start'

fi


echo "using VTCUSTOM=$VTCUSTOM/companydefault.cnf"

mysqlctl \

 --mysqlctl_mycnf_template $VTCUSTOM/companydefault.cnf \

 --log_dir $VTDATAROOT/tmp \

 --tablet_uid $uid \

 --mysql_port $mysql_port \

 $action



The execution output

vtgate is up!

Access vtgate at http://d76-2.oak.smle.co:15001/debug/status

Starting company Customized MySQL including the mysql 8.0 vitess defaults for tablet zone1-0000000100...

*****init file = /home/dba/vitess/config/init_db_vt.sql

using VTCUSTOM=/home/dba/vitess/custom/conpanydefault.cnf

unknown flag: --init_db_sql_file


I have used - preceding the flag as well as --.


My other question is what does Vitess use to refer to the new passwords?

Is that provided via vtgate-up.sh

  --mysql_auth_server_impl=static \

  --mysql_auth_server_static_file $VTCONFIG/users.json \

which I am already using successfully for controlling vtgate access.


All information is appreciated.


Scott







Reply all
Reply to author
Forward
0 new messages