Getting MySQL working on OSX 10.7 Lion

后端 未结 6 565
一向
一向 2020-12-12 17:19

I\'m currently trying to get MySQL working on OSX 10.7 Lion. I tried the brew way:

brew install mysql
-> cmake        -> no problems
-> make                 


        
相关标签:
6条回答
  • 2020-12-12 17:33

    All,

    I was having issues with connecting to my DB through Tomcat, yet could through the MySql tool. Tomcat was accessing it through the actual IP of my machine (10.0.x.x) instead of through localhost or 127.0.0.1. Turns out that when I migrated from SL to Lion, remote connections were disabled. Once I enabled them, it worked fine.

    Hopefully this helps someone.

    0 讨论(0)
  • 2020-12-12 17:37

    You need to set up your path environment too, and it's also good practise to set a root password while you're at it. I've created a full step-by-step here: How to install MySQL on Lion (Mac OS X )

    0 讨论(0)
  • 2020-12-12 17:43

    A drop in replacement for mysql is mariadb. You can install with 'brew install mariadb'. It builds on Lion.

    Existing mysql drivers and clients just work. I'm using it with python-mysql and django.

    It's even called mysql so you won't even know the difference.

    0 讨论(0)
  • 2020-12-12 17:44

    You can download a MySQL installer as a DMG file, complete with an installer, system preferences pane and a startup script directly from MySQL. Go to MySQL's community server download page, select Mac OS X as the platform and pick the DMG file.

    You can skip the registration form (there a little link under the signup form) and you should be on your way.

    Once the file is downloaded, double-click on the DMG, launch the installer and complete the installation. After that, install the startup script using its installer and finally the preferences pane by double-clicking on it. I highly recommend choosing to install it for all users on the computer.

    You'll find this way much easier than compiling from source.

    You should check out Sequel Pro if you need a great OS X tool to manage your MySQL databases.

    0 讨论(0)
  • 2020-12-12 17:46

    Ha! Got it!

    First... download mysql-5.6.2 here: http://dev.mysql.com/downloads/mirror.php?id=402349#mirrors ... once finished, untar the file and do this:

    mv path/to/mysql-5.6.2-m5-osx10.6-x86_64 /usr/local/mysql
    echo "PATH=\$PATH:/usr/local/mysql/bin" >> ~/.profile
    # open a new tab
    cd /usr/local/mysql #this is essential!
    ./scripts/mysql_install_db
    mysqld_safe &
    mysql -uroot
    

    works for me :)

    0 讨论(0)
  • 2020-12-12 17:55

    I had MySQL installed already, but after upgrading to Lion it would no longer start.

    I tried installing the latest official version and it still wouldn't start.

    Finally, this fixed it:

    $ sudo mkdir /var/log/mysql
    $ sudo chown mysql:mysql /var/log/mysql
    
    0 讨论(0)
提交回复
热议问题