Hi--
- Now the docs said with the MySQLStartupItem the
MySQL will start automatically during system startup.
Does this mean the MySQL server will be activated
automatically?
Yes, once you install that, it should start when you reboot your computer.
When
I use the first I get this -- ./bin/mysqld_safe:
line 1: ./bin/my
printdefaults: cannot execute
binary file
/bin/mysqld_safe: line 1: ./bin/my
printdefaults:
cannot execute binary file
Starting mysqld daemon with databases from
/usr/local/mysql/data
STOPPING server from pid file
/usr/local/mysql/data/robert-bennetts-imac.local.pid
061203 00:02:43 mysqld ended
Well, you'd have to post exactly what command you're using. The MySQL daemon is started by
mysqld_safe, but if you look, that's just a shell script that does a bunch of things to set it all up, eventually resulting in the MySQL daemon starting up. One thing to keep in mind is that the daemon has to run as the
mysql user, which is already set up on your computer, but you have to tell it to:
<pre class="command">./bin/mysqld_safe --user-mysql &</pre>
Also, when I used the mysqld_safe to start the server, I had problems starting the server because of having to give my password. So I would start it with the following series of commands:
<pre class="command">cd /usr/local/mysql
sudo su
./bin/mysqld_safe --user-mysql &
exit</pre>Once I'd supplied my password in the second step, I had root privileges, so I didn't have the problem with the password any more. Note that after the third step, you'll get some status text printed on the screen. If it's unsuccessful starting, you should get the reason why. If it starts successfully, you'll eventually get back to a shell prompt. One of the last things it prints will be a number in brackets:
[nnnnn], which is the process id of MySQL.
You should be able to see
mysqld in the Activity Monitor if you set it to look at "All Processes." Otherwise, it's also possible to check for it in the Terminal:
<pre class="command">ps ax | grep -v grep | grep mysql</pre>You should see two lines similar to this (they're truncated, by the way, to the width of the Terminal window):
<pre class="command">10367 p1- S 0:00.04 /bin/sh ./bin/mysqld_safe --datadir=/usr/local/mysql/
10387 p1- S 3:21.05 /usr/local/mysql/bin/mysqld --defaults-extra-file=/us</pre>
When I use sudo
/Library/StartupItem/MySQLCOM/MySQLCOM start i get --
Starting MySQL database server but I'm not convinced
it's working because none of the commands that the
docs say should work actually work.
If you're using the startup item, it should print out error messages if it can't start the server. As Jun says in his post, you need to add
/usr/local/mysql/bin to your shell
$PATH.
Help much appreciated. This has been a wall I've
been unable to break through.
Like you, I had trouble with all this at first. I used the
MySQL Visual QuickStart Guide by Larry Ullman to get going. I found it to be very helpful, especially at the early stages of learning about MySQL. I still refer to it periodically, so it's a handy reference to have.
charlie