can't start MySql in Mac OS 10.6 Snow Leopard

2019-01-13 00:36发布

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

16条回答
做个烂人
2楼-- · 2019-01-13 01:26
  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 &
查看更多
姐就是有狂的资本
3楼-- · 2019-01-13 01:28

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

查看更多
混吃等死
4楼-- · 2019-01-13 01:32

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.

查看更多
甜甜的少女心
5楼-- · 2019-01-13 01:37

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.

查看更多
登录 后发表回答