views:

28873

answers:

11

I've googled this and could'nt find anything new and useful for Apple's new OS SnowLeopard. I wonder if this is my mistake or I do need to do something?

this is what I did:

Downloaded from mysql site: http://dev.mysql.com/downloads/mysql/5.1.html#macosx-dmg I choose : Mac OS X 10.5 (x86_64)

I run all the packages and installed all of them. So now I certainly have mysql in

/usr/local/mysql/

But when trying to start it from preferences panel, it is always STOPPED. When I try to do (in the terminal):

/usr/local/mysql/bin/mysql

I got :

-bash: /usr/local/mysql/bin/mysql: Bad CPU type in executable

What is wrong here? Any help would be very appreciated. Thanks

+1  A: 

Have you considered installing MacPorts 1.8.0 (release candidate), and keeping MySQL up-to-date that way? That will build MySQL for the architecture and OS that you're using, rather than installing a 10.5 version on 10.6.

Nerdling
Thanks,... I wouldn't mind using MacPorts 1.8.0actually I am using it, but I don't know what version is it.Still, I did a serch:port seach mysql but I should have missed because all the results where plugins, and controllers , etc.How can I know what version do i have?what is the command for mysql installation?(ie. port install mysql-5)
nacho4d
You'll likely want any of the "mysql5" ports: mysql5 or mysql5-server. There's also mysql5-devel and mysql5-server-devel ports.
Nerdling
I removed and installed as you suggested but, I still cannot start it.This is what I did:sudo /opt/local/lib/mysql5/bin/mysql_install_db --user=mysql(it worked fine)/opt/local/lib/mysql5/bin/mysql_secure_installationEnter current password for root (enter for none): ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' (2)
nacho4d
/opt/local/lib/mysql5/bin/mysqladmin -u root password nachito14/opt/local/lib/mysql5/bin/mysqladmin: connect to server at 'localhost' failederror: 'Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' (2)'Check that mysqld is running and that the socket: '/opt/local/var/run/mysql5/mysqld.sock' exists!
nacho4d
It doesn't look like you've got it running. It creates a startup item by default, try launching it (or restarting).also, hop on the MacPorts IRC to ask for help: irc.freenode.net #macports
Nerdling
# sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
Nerdling
A: 

snow leopard is different to the "old" leopard therefore its not surprising that the sources won' work... you should probably wait till the official release on friday and oracle might be releasing a properly working sql version soon.

Gnark
In Snow Leopard, Apple is finishing the transition to 64 bit. This means that the enitre OS (+apps) is pure 64-bit as opposed to leopard which only had some subsystems running on 64 bit. It is no surprise that software which was compiled for Leopard won't work flawless with Snow Leopard, especially since Apple shipped a dev-Version of Snow Leopard so that developers could test their apps before the official Launch.
Mike
I think I got the 64-bit version though...
nacho4d
Snow Leopard is Intel only, but not 64-bit only. Everything runs on 32- or 64-bit depending on the host machine. MySQL should really build a dual 32.64 version.
matt
+2  A: 

I'd guess that your iMac isn't 64-bit (you state in another thread it is an original white intel iMac). Try the 32-bit version of MySQL–it should install directly over the 64-bit version, I think.

How to tell if your Intel-based Mac has a 32-bit or 64-bit processor
http://support.apple.com/kb/HT3696

matt
I check it and it is 64 bit ;) thanks
nacho4d
A: 

Along with making sure you install the 64bit version, also check to make sure that the symbolic link of '/usr/local/mysql' is pointing to the correct version of your installation:

lrwxr-xr-x   1 root  wheel    27B Aug 29 01:24 mysql -> mysql-5.1.37-osx10.5-x86_64
drwxr-xr-x   3 root  wheel   102B Aug 29 01:25 mysql-5.1.30-osx10.5-x86
drwxr-xr-x  11 root  wheel   374B Aug 29 15:59 mysql-5.1.37-osx10.5-x86_64
drwxr-xr-x  17 root  wheel   578B Jul 13 22:06 mysql-5.1.37-osx10.5-x86_64.old

Alos, I found that after my installation, even though I used the pkg file from MySQL various other libraries would not build against the installation. The solution was to follow the steps to build MySQL from source found here. You can manually start it as root with the command:

/usr/loca/mysql/bin/mysqld_safe [whatever options you use]

Now ... to get the preference pane working I did the following:

  1. Installed 64bit version of MySQL Server packet from mysql.com
  2. Moved the package from mysql-5.1.37-osx10.5-x86_64 to mysql-5.1.37-osx10.5-x86_64.old
  3. Did a manual compile and installation of MySQL as per these instructions
  4. Executed the following command:

    sudo cp -R /usr/local/mysql-5.1.37-osx10.5-x86_64.old/support-files /usr/local/mysql/.

  5. Opened up the MySQL Preference Pane and tada! it works

Wyatt
+12  A: 

YOU MUST REINSTALL mySQL after upgrading to Snow Leopard and remove any previous versions as well as previous startup from the preference panel. install 86_64 10.5...I find the others did not work for me.

  1. Download MySQL version Mac OS X 10.5 (x86_64) located at http://dev.mysql.com/downloads/mysql/5.4.html#macosx-dmg
  2. Install startup Item (follow instructions)
  3. Then install the beta version (follow instructions)
  4. If you want the start up in the Preference Panel...install mySQL.prefpane I find that SQL does not run from the terminal unless you start mySQL in the preference panel.
Must one really reinstall MySQL after upgrading to Snow Leopard? I didn't and once I removed all references to my MacPorts installation from .bash_profile, MySQL is running fine *and* can be started and stopped from the System Preferences panel. If it ain't broke, don't fix it.
Elise van Looij
How do we "remove any previous versions as well as previous startup from the preference panel?"
Pilgrim
+6  A: 

Okay... Finally I could install it! Why? or what I did? well I am not sure. first I downloaded and installed the package (I installed all the files(3) from the disk image) but I couldn't start it. (nor from the preferences panel, nor from the termial)

second I removed it and installed through mac ports.

again, the same thing. could not start it.

Now I deleted it again, installed from the package. (i am not sure if it was the exact same package but I think it is) Only this time I got the package from another site(its a mirror).

the site:

http://www.mmisoftware.co.uk/weblog/2009/08/29/mac-os-x-10-6-snow-leopard-and-mysql/

and the link:

http://mirror.services.wisc.edu/mysql/Downloads/MySQL-5.1/mysql-5.1.37-osx10.5-x86.dmg

1.- install mysql-5-1.37-osx10.5-x86.pkg

2.- install MySQLStartupItem.pkg

3.- install MySQL.prefpanel

And this time is working fine (even the preferences panel!)

Nothing special, I don't know what happened the first two times.

But thank you all. Regards.

nacho4d
If you have the time, it might be worth comparing the two packages (failing and working). Do they have the same name? If so, are they identical files (run a diff on them). I'd assume not; it might be worth notifying the mirror with the failing file in case they have a problem.
Dancrumb
I went through the same thing. Kept getting the mysqld.sock error. It was the install MySQL.prefpanel that fixed it for me. What a pain..
Nick
A: 

I have installed mysql-5.4.2-beta-osx10.5-x86_64 and I'm also getting:

 -bash: /usr/local/mysql/bin/mysql: Bad CPU type in executable

I don't see a resolved issue in this thread. Have you guys found how to fix this issue?

wadada
A: 

I followed the exact same steps as answer #4....frustrating I know, but it finally worked when I installed the beta version and removed everything completely.

removal help:

sudo rm /usr/local/mysql sudo rm -rf /usr/local/mysql* sudo rm -rf /Library/StartupItems/MySQLCOM sudo rm -rf /Library/PreferencePanes/My* rm -rf ~/Library/PreferencePanes/My* sudo rm -rf /Library/Receipts/mysql* sudo rm -rf /Library/Receipts/MySQL* sudo rm -rf /private/var/db/receipts/com.mysql*

Then edit /etc/hostconfig and remove the line MYSQLCOM=-YES-

Also go to: /Library/Receipts and look for a file named “InstallHistory.plist”… It’s just a regular property list… Open it and look for the MySQL entry, and delete it

kinet
A: 

Easiest Solution I've found:

After installing the MySQL package for Mac OS X Snow Leopard (check whether you have a 32bit or 64bit processor). Can always default to the 32bit version to be safe.

Simply click to install the MySQL preferences inside the dmg and when prompted whether to allow access for just you or for the entire system, choose entire system.

This worked great for me.

Stephen
+2  A: 
xgretsch
This worked great for me. Thanks for saving me hours of hassle!
Mike
A: 

See this - recreating the symlink may be all you need to do: http://planet-geek.com/archives/2009/09/osx-snow-leopar.html

matt