Greg Willits wrote:
On May 20, 2004, at 11:08 AM, Sasha Pachev wrote:
Greg Willits wrote:

I have two mysql apps running on the same machine (OS X 10.3.3). A mysql 3.23.54 on port 14551, and a mysql 4.0.16 on 3306. Each has a config file specifying the port and a unique socket name in /tmp. They have coexisted just peachy for a very long time.
Now however, w/o any changes to either MySQL3, MySQL4, or the OS, every time I issue a terminal command to one of the MySQL3 bin apps preceded by the usual cd /x/y/z/bin, the commands are being sent to the /usr/local/mysql bin apps on 3306. If I shut mysqld 3306 down (which closes the sock file), then any commands to mysql 14551 gripes that there is no socket file even though the one it should be using is still available.

Do not worry about why it stopped working - it was not supposed to anyway, and if it did, it was pure luck :-)
I was lucky for over two years across several machines then. I think that may be my best streak of anything ever. Too bad there was no money involved! ;-)
A clean way to solve the problem would be to create small shell scripts called mysql-3 and mysql-4 that will connect to the right instance.
I've started that process, though I'm not much of a shell scripter yet. So it's time to dig in or get used to specifying the socket I guess. OK. Well, at least I know.


On May 21, 2004, at 12:54 PM, Sasha Pachev wrote:
You do not need to be much of a shell scripter - it is just one line for each script:
put in /usr/local/bin/mysql-3:
------------start-----------
#! /bin/sh
mysql --socket=/tmp/mysql-3.sock
------------end---------------
put in /usr/local/bin/mysql-4:
--------------start----------
#! /bin/sh
mysql --socket=/tmp/mysql-4.sock
--------------end----------------
Make sure to exclude the ---- start/end marker lines when you paste, and fix the socket path if I guessed it wrong, if this is not obvious


Execute
chmod +x /usr/local/bin/mysql-3
chmod +x /usr/local/bin/mysql-4

Sure. I'm all set for the mysql daemons. I did that through aliases. The bigger hassle is all the utilities.


I either type

        ./mysqladmin -u **** -p --socket-/tmp/mysql.sock version

Or I find a way to shell script for something like

        ./mysqladmin4 -u **** -p version

or for that matter while I'm at it...

        ./mysqladmin4 version

Same goes for dump and some others. I haven't yet looked into the ins & outs (err, no pun intended) of writing shell scripts to accomplish that. I can add to my aliases, and I can write simple one liners like that -- just don't know how to interface to inputs, variables, how to deal with pauses for passwords, etc. I'm sure it'll be relatively straight forward once I read up on it.

Thanks for trying to help :-)

-- greg willits
                




-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to