Need help activating Macports install of MySQL5 on Snow Leopard
William H. Magill
magill at mcgillsociety.org
Thu Dec 17 18:56:24 PST 2009
On Dec 14, 2009, at 8:51 PM, Ryan Schmidt wrote:
>> I don't know if I still need to do more things using the macports mysql tools (and which ones), or if I need to find something specific to generic Mysql.
>> I'm assuming I am tripping over all of the things which only ever need to be done once when MySQL is first installed, and never again under updates.
>>
>> So, I'm looking for some kind of tutorial/cookbook for "installing" MySQL5 on Snow Leopard.
>>
>> Quite frankly, at this point, I don't know what i don't know, but assume it to be substantial.
>
> Give the MySQL section of the MAMP how-to a try and please make any necessary corrections (or let us know and we'll make them).
I'll let you folks make the changes as I don't feel confident enough in my conclusions, since this is my first time through.
Ok... Installing mysql-server apparently was the big thing.
Had to completely remove (not just port uninstall) the macports MySql5 installation including:
/opt/local/etc/mysql5
/opt/local/var/db/mysql5
/opt/local/var/run/
to start over again.
Miscellaneous things I've noticed...
1- MAMP ... Under Snow Leopard, the pre-existing userid/groupid for mysql is "_mysql" -- note the preceding underscore.
However, the script: "sudo -u mysql mysql_install_db5" does correctly set the ownership permissions on the files mentioned in the next 3 lines
(to "_mysql", not "mysql")
2- The install script "port install myql5-server" ends with
---> Activating mysql5-server @5.1.41_0
but does, in fact NOT activate the server -- the comment earlier in the script,
###########################################################
# A startup item has been generated that will aid in
# starting mysql5-server with launchd. It is disabled
# by default. Execute the following command to start it,
# and to cause it to launch at startup:
#
# sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
###########################################################
should probably be output at that point.
3- in the output from "sudo -u _mysql mysql_install_db5" is the comment:
"You can test the MySQL daemon with mysql-test-run.pl
cd /opt/local/mysql-test ; perl mysql-test-run.pl"
except that the directory "/opt/local/mysq-test" does not exist nor does the perl script.
HOWEVER, There is a man page for "mysql-test-run.pl"
(Note: there is also a man page for "mysql-test-run.pl" also exists, but no script)
sudo find . -name *\test\* -print ... yields:
./bin/mysql_client_test5
./bin/mysql_client_test_embedded5
./bin/mysqltest5
./bin/mysqltest_embedded5
./lib/mysql5/bin/mysql_client_test
./lib/mysql5/bin/mysql_client_test_embedded
./lib/mysql5/bin/mysqltest
./lib/mysql5/bin/mysqltest_embedded
./lib/mysql5/bin/ndb_test_platform
./share/macports/Tcl/port1.0/porttest.tcl
./share/man/man1/mysql-stress-test.pl.1.gz
./share/man/man1/mysql-test-run.pl.1.gz
./share/man/man1/mysql_client_test.1.gz
./share/man/man1/mysql_client_test_embedded.1.gz
./share/man/man1/mysqltest.1.gz
./share/man/man1/mysqltest_embedded.1.gz
./share/man/man3/BN_is_prime_fasttest.3.gz
./share/mysql5/mysql/mi_test_all
./share/mysql5/mysql/mi_test_all.res
./share/mysql5/mysql/mysql_test_data_timezone.sql
./share/readline/rlptytest.c
./share/readline/rltest.c
./var/db/mysql5/test
./var/macports/software/mysql5/5.1.41_0/opt/local/bin/mysql_client_test5
./var/macports/software/mysql5/5.1.41_0/opt/local/bin/mysql_client_test_embedded5
./var/macports/software/mysql5/5.1.41_0/opt/local/bin/mysqltest5
./var/macports/software/mysql5/5.1.41_0/opt/local/bin/mysqltest_embedded5
./var/macports/software/mysql5/5.1.41_0/opt/local/lib/mysql5/bin/mysql_client_test
./var/macports/software/mysql5/5.1.41_0/opt/local/lib/mysql5/bin/mysql_client_test_embedded
./var/macports/software/mysql5/5.1.41_0/opt/local/lib/mysql5/bin/mysqltest
./var/macports/software/mysql5/5.1.41_0/opt/local/lib/mysql5/bin/mysqltest_embedded
./var/macports/software/mysql5/5.1.41_0/opt/local/lib/mysql5/bin/ndb_test_platform
./var/macports/software/mysql5/5.1.41_0/opt/local/share/man/man1/mysql-stress-test.pl.1.gz
./var/macports/software/mysql5/5.1.41_0/opt/local/share/man/man1/mysql-test-run.pl.1.gz
./var/macports/software/mysql5/5.1.41_0/opt/local/share/man/man1/mysql_client_test.1.gz
./var/macports/software/mysql5/5.1.41_0/opt/local/share/man/man1/mysql_client_test_embedded.1.gz
./var/macports/software/mysql5/5.1.41_0/opt/local/share/man/man1/mysqltest.1.gz
./var/macports/software/mysql5/5.1.41_0/opt/local/share/man/man1/mysqltest_embedded.1.gz
./var/macports/software/mysql5/5.1.41_0/opt/local/share/mysql5/mysql/mi_test_all
./var/macports/software/mysql5/5.1.41_0/opt/local/share/mysql5/mysql/mi_test_all.res
./var/macports/software/mysql5/5.1.41_0/opt/local/share/mysql5/mysql/mysql_test_data_timezone.sql
=====================================================================================
4- One thing which I don't understand (may just be my lack of MySQL knowledge) is why the commands...
(from the install output)
/opt/local/lib/mysql5/bin/mysqladmin -u root password 'new-password'
/opt/local/lib/mysql5/bin/mysqladmin -u root -h shianbrae.mcgillsociety.org
both fail...
/opt/local/lib/mysql5/bin/mysqladmin -u root password 'xxx'
/opt/local/lib/mysql5/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
If you try to run them a second time.
but the command: mysqladmin5 -u root -p password <new-password>
from the MAMP does work, prompting you for the existing password.
=====================================================================================
5- if you "sudo port uninstall mysql5-server"
It claims :
---> Deactivating mysql5-server @5.1.41_0
---> Uninstalling mysql5-server @5.1.41_0
But the server continues to run. And, since the plist file is now gone, you can't "unload" it...
sudo launchctl unload -w /Library/LaunchDaemons/org.macports.mysql5.plist
launchctl: Couldn't stat("/Library/LaunchDaemons/org.macports.mysql5.plist"): No such file or directory
nothing found to unload -- and, naturally, you can't kill it because Launchd will respawn it, forcing a reboot
=====================================================================================
So, the short is, I have the server working (accordng to the MAMP page) and now have to figure out how to
authorize users!
Time to break down and RTFM.
T.T.F.N.
William H. Magill
# Flat-panel iMac (2.1) [800MHz - Super Drive - 768 Meg] OS X 10.4.11
# iMac6,1 Core 2 Duo [2.16GHz - 3 GB 667] OS X 10.6.2
# MacBook Pro4.1 Core 2 Duo [2.5GHz - 4GB 667] OS X 10.6.2
# Mac mini Core Duo [1.66 Ghz - 2 GB 667]OS X 10.6.2
# PWS433a [Alpha 21164 Rev 7.2 (EV56)- 64 Meg] Tru64 5.1a
# XP1000 [Alpha 21264-3 (EV6) - 256 meg] FreeBSD 5.3
# XP1000 [Alpha 21264-A (EV6-7) - 256 meg] FreeBSD 5.3
magill at mcgillsociety.org
magill at mac.com
whmagill at gmail.com
More information about the macports-users
mailing list