@@ -667,7 +667,7 @@ func startStandalonePXC(ctx context.Context, config PXCConfig) error {
667667
668668func waitForPXCMySQL (ctx context.Context , config PXCConfig ) error {
669669 socket := filepathJoin (config .DataDir , "mysql.sock" )
670- deadline := time .Now ().Add (90 * time .Second )
670+ deadline := time .Now ().Add (10 * time .Minute )
671671 for time .Now ().Before (deadline ) {
672672 for _ , pass := range []string {config .MySQLPassword , "" } {
673673 pingCmd := exec .CommandContext (ctx , pxcMysqladminPath (), "--socket" , socket , "-u" , "root" , "ping" )
@@ -695,7 +695,25 @@ func waitForPXCMySQL(ctx context.Context, config PXCConfig) error {
695695 case <- time .After (3 * time .Second ):
696696 }
697697 }
698- return fmt .Errorf ("timeout waiting for mysqld on port %d" , config .MySQLPort )
698+ return fmt .Errorf ("timeout waiting for mysqld on port %d: %s" , config .MySQLPort , pxcRecentLogs (ctx , config ))
699+ }
700+
701+ func pxcRecentLogs (ctx context.Context , config PXCConfig ) string {
702+ cmd := exec .CommandContext (ctx , "bash" , "-lc" , fmt .Sprintf (`for f in %s %s; do
703+ if [ -s "$f" ]; then
704+ echo "== $f =="
705+ tail -80 "$f"
706+ fi
707+ done` , shellQuote (pxcStartupLogPath (config )), shellQuote (pxcErrorLogPath (config ))))
708+ out , err := cmd .CombinedOutput ()
709+ if err != nil {
710+ return fmt .Sprintf ("failed to read PXC logs: %v, output: %s" , err , strings .TrimSpace (string (out )))
711+ }
712+ logs := strings .TrimSpace (string (out ))
713+ if logs == "" {
714+ return "PXC startup and error logs are empty"
715+ }
716+ return logs
699717}
700718
701719func setPXCRootPassword (ctx context.Context , config PXCConfig ) error {
0 commit comments