can't start MySql in Mac OS 10.6 Snow Leopard

后端 未结 16 2490
灰色年华
灰色年华 2020-12-04 13: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 w

相关标签:
16条回答
  • 2020-12-04 13:12

    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.

    0 讨论(0)
  • 2020-12-04 13:14

    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.

    0 讨论(0)
  • 2020-12-04 13:15

    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

    0 讨论(0)
  • 2020-12-04 13:16

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

    0 讨论(0)
  • 2020-12-04 13:17

    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.

    0 讨论(0)
  • 2020-12-04 13:20
    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 &
    0 讨论(0)
提交回复
热议问题