Tinderbox/Tbox3 Setup: Difference between revisions

Jump to navigation Jump to search
Line 72: Line 72:


   yourmachine:~# cd tbox3/sql
   yourmachine:~# cd tbox3/sql
   yourmachine:~# ./setup-mysql.pl --username tbox3 --password pass
   yourmachine:~# ./setup-mysql.pl tbox --username tbox3 --password pass


This gives errors saying it can't drop tables. That's okay; if you run it
This gives errors saying it can't drop tables. That's okay; if you run it
Line 78: Line 78:


Note that there appears to be an error in the setup-mysql.pl script: the short form for both "port" and "password" is specified as "p".  The above text previously had "-p pass", which did not work until I used the long version.  Something else is wrong with the script, and I'm working on debugging that now; will update this section when finished.
Note that there appears to be an error in the setup-mysql.pl script: the short form for both "port" and "password" is specified as "p".  The above text previously had "-p pass", which did not work until I used the long version.  Something else is wrong with the script, and I'm working on debugging that now; will update this section when finished.
Okay, it appears that mysql (the client) does not want the password on the command line.  So you need to edit setup-mysql.pl, and change the following line (towards the end of the subroutine execute_sql_file); change the first line below to be the second line below:
  push @exec_params, ("-p", $args{password}) if $args{password};
  push @exec_params, ("-p") if $args{password};
Now, instead of giving you several failed drop messages, then the mysql client help, it will instead give you several failed drop messages, then ask for your password.  This is the password to the tbox3 user you created above.  After entering the password, there should be no more messages.
(For the belt-and-suspenders crowd, go ahead and re-run the script.  This time, you'll see it drop 12 tables (which it names), then ask for your password, and then you get the bash prompt back almost immediately.)


=== Code Changes ===
=== Code Changes ===
21

edits

Navigation menu