LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-23-2011, 11:26 PM   #1
DJRcomputing
Member
 
Registered: Mar 2011
Location: /usa/pa/manheim
Distribution: Debian 5 + Xfce
Posts: 64

Rep: Reputation: 6
Question MySQL boot syntax error ')'??


Mental note: ignore start-up process scroll.

Okay, now MySQL is just being (even more) difficult. Prior to boot's starting MySQL, I notice the line

Code:
/etc/rc2.d/S19mysql: line 132: syntax error near unexpected token ')'
Near?? Line 132 consists of

Code:
'stop')
Which is proper, and identical to all the other /etc/rc#.d/S19mysql scripts that don't result in errors. C'mon...!

Though it seems like a non-issue, any ideas as to a solution?
 
Old 05-23-2011, 11:35 PM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Did you run a diff on the scripts to make sure they are the same; a space or <tab> that you don't see can already be a pain.

And the problem is probably just before line 132; maybe a missing semicolon?
 
Old 05-24-2011, 12:48 AM   #3
DJRcomputing
Member
 
Registered: Mar 2011
Location: /usa/pa/manheim
Distribution: Debian 5 + Xfce
Posts: 64

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by Wim Sturkenboom View Post
Did you run a diff on the scripts to make sure they are the same...
diff didn't output anything, so I'm guessing they're the same:

Code:
# diff /etc/rc2.d/S19mysql /etc/rc3.d/S19mysql
#
Quote:
Originally Posted by Wim Sturkenboom View Post
...a space or <tab> that you don't see can already be a pain.
Which is why I'm not a coder. Kudos to those who are. The extent of my hacking: Off The Mark cartoon.

Quote:
Originally Posted by Wim Sturkenboom View Post
And the problem is probably just before line 132; maybe a missing semicolon?
Since I'm not proficient in coding (scripts), I just attached the script file so those who know can check it. If someone patches it, just attached the fixed S19mysql to your reply, please. Thanks.
Attached Files
File Type: txt S19mysql.txt (5.6 KB, 18 views)
 
Old 05-24-2011, 01:14 AM   #4
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Code:
case "${1:-''}" in
  'start')
	sanity_checks;
	# Start daemon
	log_daemon_msg "Starting MySQL database server" "mysqld"
	if mysqld_status check_alive nowarn; then
	   log_progress_msg "already running"
	   log_end_msg 0
	else
  	    /usr/local/mysql/bin/mysqld_safe > /dev/null 2>&1 &
	    # 6s was reported in #352070 to be too few when using ndbcluster
	    for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14; do
                sleep 1
	        if mysqld_status check_alive nowarn ; then break; fi
		log_progress_msg "."
	    done
	    if mysqld_status check_alive warn; then
                log_end_msg 0
	        # Now start mysqlcheck or whatever the admin wants.
	        output=$(/var/mysql/mysql-start)
		[ -n "$output" ] && log_action_msg "$output"
	    else
	        log_end_msg 1
		log_failure_msg "Please take a look at the syslog"
	    fi
	fi

	# Some warnings
        # if $MYADMIN variables | egrep -q have_bdb.*YES; then
        #    echo "BerkeleyDB is obsolete, see /usr/share/doc/mysql-server-5.0/README.Debian.gz" | $ERR_LOGGER -p daemon.info
        # fi
        # if [ -f /etc/mysql/debian-log-rotate.conf ]; then
        #    echo "/etc/mysql/debian-log-rotate.conf is obsolete, see /usr/share/doc/mysql-server-5.0/NEWS.Debian.gz" | $ERR_LOGGER -p daemon.info
        # fi
	# ;;

  'stop')
I think you're problem will be solved by removing the # in the line that I marked in bold red

If you look at all the other options (stop, restart, ...), they are terminated by a double semicolon before the next option. But for the start one that double semicolon is commented out.

Keeps the question why the other runlevels don't complain (unless you have not actually tried them)
 
Old 05-24-2011, 07:10 AM   #5
DJRcomputing
Member
 
Registered: Mar 2011
Location: /usa/pa/manheim
Distribution: Debian 5 + Xfce
Posts: 64

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by Wim Sturkenboom View Post
I think you're problem will be solved by removing the # in the line that I marked in bold red
Thaaaat didn't work. The resulting error(s) made me laugh, as it reminded me of my website's 404 page.

Code:
/etc/rc2.d/S19mysql: WARNING: /etc/init/my.cnf cannot be read. Blame LOLcat (warning).
Starting MySQL database server: mysqld . . . . . failed!
Quote:
Originally Posted by Wim Sturkenboom View Post
If you look at all the other options (stop, restart, ...), they are terminated by a double semicolon before the next option. But for the start one that double semicolon is commented out.
I actually put the ;; below the 2nd fi at the end of the 'start') section. Same result, but seemed like better form. Interestingly, the 'stop') section ends in a double fi without the ;; too, yet no complaints. *shrug*

Quote:
Originally Posted by Wim Sturkenboom View Post
Keeps the question why the other runlevels don't complain (unless you have not actually tried them)
Shhh...I'm just glad my server runs, regardless of whichever runlevel it choses, since it's my first foray into Linux. FWIW, I just noticed that during shutdown, it gives the same error regarding /etc/rc0.d/K21mysql, which is identical to S19mysql.

Last edited by DJRcomputing; 05-24-2011 at 07:13 AM.
 
Old 05-24-2011, 07:43 AM   #6
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Quote:
Originally Posted by DJRcomputing View Post
I actually put the ;; below the 2nd fi at the end of the 'start') section. Same result, but seemed like better form. Interestingly, the 'stop') section ends in a double fi without the ;; too, yet no complaints. *shrug*
All sections end with ';;' except the start one.

Code:
case "${1:-''}" in
  'start')
...
	# ;;

  'stop')
...
	;;

  'restart')
...
	;;

  'reload'|'force-reload')
...
	;;

  'status')
...
  	;;

  *)
...
	;;
esac
I've stripped all the stuff out so you can see the frame work of the case and the difference between the start section and the others.

Don't care about number of fi's unless you start counting the if's as well
 
Old 05-27-2011, 11:17 PM   #7
DJRcomputing
Member
 
Registered: Mar 2011
Location: /usa/pa/manheim
Distribution: Debian 5 + Xfce
Posts: 64

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by Wim Sturkenboom View Post
All sections end with ';;' except the start one.
*sigh* Thank you for carefully reading my previous reply:

Quote:
Originally Posted by DJRcomputing View Post
Thaaaat didn't work. The resulting error(s) made me laugh, as it reminded me of my website's 404 page.
However,

Quote:
Originally Posted by Wim Sturkenboom View Post
I've stripped all the stuff out so you can see the frame work of the case and the difference between the start section and the others.

Don't care about number of fi's unless you start counting the if's as well
I appreciate you pointing out my oversight. I thought the 'stop') case ended @ line 154, and not 163, as if a new case invisibly started at 156. Whoops. LOL!

I've also learned that /etc/rc#.d/###mysql are just symlinks to /etc/init.d/mysql for the different runlevels, so of course they're all the same. Duh...

Finally, I asked my father, who's a proficient coder, and he recommended the same thing you did. I guess I'll just live with the benign "splinter" (ie: annoying) syntax error, which beats failed! any day.

In the end, I consider this resolved, unless anyone has the "solution", but not [SOLVED]. However, it's not worth any more of my time. I'm still going to report the bug, so their devs look into their own coding.
 
Old 05-29-2011, 08:22 AM   #8
DJRcomputing
Member
 
Registered: Mar 2011
Location: /usa/pa/manheim
Distribution: Debian 5 + Xfce
Posts: 64

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by DJRcomputing View Post
MySQL is just being (even more) difficult.
Oooookay?! The problem just...fixed itself? The error went away...on it's own? Just...disappeared? Even the runlevel symlinks are gone. *boggles* I didn't delete it/them. mysql.server is there, but...

http://dev.mysql.com/doc/refman/5.0/...tic-start.html

The MySQL daemon loads like it always has, which I thought was tied into /etc/init.d/mysql, as an executable copy of mysql.server...so how was /etc/init.d/mysql different, and where'd IT come from?? I'm so confused. I could rename mysql.server to mysql & the ###mysql.server symlinks to ###mysql, but I'm leaving this $h!+ alone & marking this b!+ch [SOLVED] while I can. I get that my server is "possessed" by daemons & all, but...???

Then again, it could be my cats. *shrug* (Malicious li'l hackers.) Maybe they were trying to help me out for a change (doubtful). They do, after all, like playing with mice...
Attached Files
File Type: txt mysql.server.txt (10.4 KB, 7 views)

Last edited by DJRcomputing; 05-29-2011 at 08:25 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] MySQL Syntax Error worm5252 Programming 5 02-10-2010 10:12 PM
[SOLVED] MySQL Error when cerating FK in tables, can't pinpoint the syntax error jason.rohde Programming 4 12-13-2009 11:50 PM
perl dbi:mysql shows error syntax error dbi:mysql ?? haxpak Linux - Server 4 02-26-2009 11:09 PM
php / MySQL: You have an error in your SQL syntax error FirstBorn Programming 6 12-31-2008 05:46 PM
MySQL Syntax Error? taylor_venable Programming 2 06-10-2007 08:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration