can't start MySql in Mac OS 10.6 Snow Leopard
Asked Answered
P

17

35

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

Parapsychology answered 26/8, 2009 at 12:15 Comment(0)
P
11

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.

Parapsychology answered 3/9, 2009 at 13:22 Comment(2)
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.Subserve
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..Corrigendum
C
27

Maybe this answer helps:

mysql5.58 unstart server in mac os 10.6.5

I just installed MySQL 5.5.8 (mysql-5.5.8-osx10.6-x86_64.dmg) on Mac os X 10.6.5 and also had the problem that MySQL was not starting.

After reading this post: http://forums.mysql.com/read.php?11,399397,399606#msg-399606 and editing the file as suggested everything started working.

I also did

sudo chown -R root:wheel /Library/StartupItems/MySQLCOM

after reading https://discussions.apple.com/message/12820394 since when restarting my Mac OSx 10.6.6 it kept on asking something about not enough privileges. The line above solved that issue.

Now everything is working.

Collation answered 21/12, 2010 at 10:40 Comment(0)
H
16

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.
Hollah answered 1/9, 2009 at 14:17 Comment(2)
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.Tuba
How do we "remove any previous versions as well as previous startup from the preference panel?"Lune
P
11

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.

Parapsychology answered 3/9, 2009 at 13:22 Comment(2)
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.Subserve
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..Corrigendum
J
9

In order just to get MySQL working again (I haven't yet looked at startup), there is no need to reinstall . I've got my copy working by doing the following:

What you need to do is this:

sudo ln -s /usr/local/mysql-5.0.51a-osx10.5-x86_64 /usr/local/mysql

This creates a symbolic link from the /usr/local/mysql directory to the location where MySQL is. This is critical, because unless you carefully backed up all your databases with mysqldump before running the Leopard upgrade, that's where all your data lives - and restoring it simply from a whole-hard-drive backup is going to be hard.

Now you can go to the right directory and start up mysql:

cd /usr/local/mysql-5.0.51a-osx10.5-x86_64

sudo ./bin/mysqld_safe

You can now do the usual CTRL-Z to get back to the shell. To make sure mysqld is running, type:

sudo ps -A|grep mysql

I got something like this:

1220 ttys000 0:00.02 /bin/sh ./bin/mysqld_safe
1240 ttys000 0:00.39 /usr/local/mysql-5.0.51a-osx10.5-x86_64/bin/mysqld --basedir=/usr/local/mysql-5.0.51a-osx10.5-x86_64 --datadir=/usr/local/mysql-5.0.51a-osx10.5-x86_64/data --user=mysql --pid-file=/usr/local/mysql-5.0.51a-osx10.5-x86_64/data/dkmac-2.home.pid --port=3306 --socket=/tmp/mysql.soc

My copy of mysql now seems to work fine. At the very least, it's good enough to run mysqldump on all my databases, so that if I need to upgrade mysql by other means and dump my data directory, I'm still in good shape.

Jamajamaal answered 16/7, 2010 at 8:51 Comment(1)
This worked great for me. Thanks for saving me hours of hassle!Irbm
E
5

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

Equestrian answered 27/8, 2009 at 10:30 Comment(0)
P
5

First of all can I just say that I really really love the Internet community for all that it does in providing answers to everybody. I don't post a lot but everybody's posting here and on so many boards helped me so much! None of them gave me the right answer mind you, but here is my unique solution to this nightmare of a spending 2 solid days trying to install MySQL 5.5.9 on Snow Leopard 10.6. Skip to bottom for resolution.

Here's what happened.

I had a server crash recently. The server was rebuilt and of course MySQL 5.5.8 didn't work. What a worthless piece. I had 5.1.54 on my other machine. That had been a pain to install as well but not like this.

I had all sorts of issues installing with the dmg from mysql.org, installing mysql5 using macports, uninstalling trying to revert to 5.1.54 (couldn't because I couldn't find the receipt file with that info even though I followed the directions). After rming everything I could find related to mysql and then reinstalling 5.5.8 everything worked! Until I rebooted... ☹ I looked in my system preference mysql pane and found mysql server wasn't starting. (skip to end for resolution)

My first error (super common) included: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysql.sock' and numerous other EXTREMELY common issues related to mysql.sock http://forums.mysql.com/read.php?11,9689,13272

Here were things I tried: 1)Create /etc/my.cnf file with the proper paths to mysql.sock. I even tried modifying mysql.server with vi directly. Modifying the php.ini was worthless. Nothing worked because MySQL wasn't starting, therefore it wasn't creating mysql.sock in the first place. Maybe you can point to the directory it is being created, and not the actual full file path i.e. not /tmp/mysql.sock but /tmp It was suggested but wasn't working because there was no mysql.sock because mysqld wasn't spawning.

2)Basedir and datadir modifications didn't work because there was no mysql.sock to point too.

Why? Because the mysql daemon wasn't starting. Without anything to start mysqld and thereby create mysql.sock I was doomed. They are an important part of the solution but if you try them and still get errors, you will know why.

3)sudo chown -R root:wheel /Library/StartupItems/MySQLCOM/

didn't solve my problem. I ended up having that folder and all items set to root:wheel though in the end, because it was one of the many things recommended and its working. Maybe it could remain _mysql but wheel works.

4)Copy mysql.sock from another machine. Doesn't work. I had searched and searched my new machine and couldn't find mysql.sock. I was using find / | grep mysql.sock because locate mysql wasn't finding anything. Besides I was trying so many different things it wasn't updating enough to find my new installs. I now like find much more than locate, even though you can update the locate db. Anyhow you can't copy mysql.sock, even if you tar it because its a 0 byte file.

THE RESOLUTION: I finally stumbled onto the solution. I finally just typed mysqld from command line while I was in the proper bin directory. It said another process was running. _mysql was spawning a process that I could see in the Activity Monitor. I killed the active mysql process and when I typed mysqld again I found it was creating my mysql.sock file in the /private/tmp/mysql.sock

The mysql pref pane wouldn't start the right process on login, so I just disabled that for being worthless. It wouldn't start mysql because no mysql.sock was being created.

By then I had figured out that mysqld creates mysql.sock. I then found /opt/local/mysql/ and typed "open bin" in the terminal window. This opened the directory with mysqld in it.

I went to login items in the system preferences in my account settings and dragged and dropped the mysqld file onto the startup items there. THAT worked. Finally!

It works flawlessly because mysqld is starting up at login, which means mysql.sock is being created so no more errors about not being able to find mysql.sock.

Pirbhai answered 25/2, 2011 at 23:56 Comment(2)
This solved my nightmare! Thanks much for taking the time to write this up. YOU are the reason this community rocksSeguidilla
proper bin directory? Which one? Also there is not /opt/local on my systemExtravaganza
E
4

open Terminal

cd /usr/local/mysql/support-files
sudo nano mysql.server

Find the lines:

basedir=
datadir=

change them to

basedir=/usr/local/mysql
datadir=/usr/local/mysql/data

Eshelman answered 8/1, 2011 at 13:58 Comment(1)
Bingo, this takes care of the startup problem. Thanks!Discernment
D
2

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.

Delubrum answered 26/8, 2009 at 12:28 Comment(6)
Thanks,... I wouldn't mind using MacPorts 1.8.0 actually 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)Parapsychology
You'll likely want any of the "mysql5" ports: mysql5 or mysql5-server. There's also mysql5-devel and mysql5-server-devel ports.Delubrum
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_installation Enter 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)Parapsychology
/opt/local/lib/mysql5/bin/mysqladmin -u root password nachito14 /opt/local/lib/mysql5/bin/mysqladmin: connect to server at 'localhost' failed error: '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!Parapsychology
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 #macportsDelubrum
# sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plistDelubrum
S
2

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

Sternum answered 29/8, 2009 at 20:17 Comment(0)
B
2

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.

Boutte answered 21/4, 2010 at 17:56 Comment(0)
L
1

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.

Ley answered 26/8, 2009 at 12:32 Comment(2)
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.Irbm
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.Equestrian
S
1

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.

Standup answered 6/6, 2010 at 22:22 Comment(0)
S
1

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

Secern answered 23/7, 2010 at 14:6 Comment(0)
P
1

my apple processor version10.6.3 is error and i can click system preference

Pushing answered 15/12, 2010 at 16:44 Comment(0)
H
1
  1. Change the following to the file /usr/local/mysql/support-files/mysql.server the follow lines:

    basedir="/usr/local/mysql"
    
    datadir="/usr/local/mysql/data"
    

    and save it.

  2. In the file /etc/rc.common add the follow line at end: /usr/local/mysql/bin/mysqld_safe --user=mysql &
Hegel answered 21/1, 2011 at 3:36 Comment(0)
C
0

I'm not entirely sure why my MySQL installation stopped working but it started trying to run as the incorrect user, as mysql instead of _mysql

Here was my error output:

140422 14:46:14 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
140422 14:46:14 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
140422 14:46:14 [ERROR] Fatal error: Can't change to run as user 'mysql' ;  Please check that the user exists!

140422 14:46:14 [ERROR] Aborting

140422 14:46:14 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

The fix for me was to edit /usr/local/mysql/bin/mysqld_safe and set the user line at the top from:

user='mysql'

to

user='_mysql'

That line was on line 25 for me with mysql-5.5.37-osx10.6-x86_64

Custos answered 23/4, 2014 at 1:0 Comment(0)
M
0

To completely uninstall on Apple Silicon (M1 or M2 ) chip run bellow commands:

brew remove mysql
rm -rf /opt/homebrew/var/mysql

To install it back:

brew install mysql
mysql.server start
mysql -uroot

And can also be run using brew services

brew services start mysql
Murraymurre answered 4/11, 2022 at 5:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.