Opened 4 years ago

Closed 4 years ago

#61267 closed defect (fixed)

mysql8: mysqld_safe: line 810: syntax error near unexpected token `then'

Reported by: murrayE Owned by: herbygillot (Herby Gillot)
Priority: Normal Milestone:
Component: ports Version: 2.6.3
Keywords: Cc:
Port: mysql8-server

Description

After installing mysql8-server, I tried running it with command:

sudo /opt/local/share/mysql8/support-files/mysql.server start

After the prompt for, and giving, my password, the following happens:

Starting MySQL
./opt/local/bin/mysqld_safe: line 810: syntax error near unexpected token `then'
/opt/local/bin/mysqld_safe: line 810: `    then    # The pid contains a mysqld process'
 ERROR! The server quit without updating PID file (/opt/local/var/run/mysqld/mysqld.pid).

Change History (3)

comment:1 Changed 4 years ago by mf2k (Frank Schima)

Cc: herbygillot removed
Keywords: syntax error removed
Owner: set to herbygillot
Status: newassigned

comment:2 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: Error in mysqld_safe from mysql8-servermysql8: mysqld_safe: line 810: syntax error near unexpected token `then'

I agree, there is a syntax error in mysqld_safe. Line 802 through 812 are:

# If there exists an old pid file, check if the daemon is already running
# Note: The switches to 'ps' may depend on your operating system
if test -f "$pid_file"
then
  PID=`cat "$pid_file"`
  if kill -0 $PID > /dev/null 2> /dev/null
  then
    if 
    then    # The pid contains a mysqld process
      log_error "A mysqld process already exists"
      exit 1

There should be something after that if on line 809.

In the original source code, those lines in scripts/mysqld_safe.sh are:

# If there exists an old pid file, check if the daemon is already running
# Note: The switches to 'ps' may depend on your operating system
if test -f "$pid_file"
then
  PID=`cat "$pid_file"`
  if @CHECK_PID@
  then
    if @FIND_PROC@
    then    # The pid contains a mysqld process
      log_error "A mysqld process already exists"
      exit 1

So evidently the placeholder @FIND_PROC@ is getting replaced with the empty string, and should be getting replaced with something else instead.

comment:3 Changed 4 years ago by herbygillot (Herby Gillot)

Resolution: fixed
Status: assignedclosed

In b2c09f817a34bcdd85b3c17eb9e505b9c273c188/macports-ports (master):

mysql8: update to 8.0.23

Note: See TracTickets for help on using tickets.