V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
zuroyu
V2EX  ›  问与答

实在是头疼,mac下安装mysql的问题

  •  
  •   zuroyu · 2011-11-12 22:54:32 +08:00 · 4445 次点击
    这是一个创建于 4743 天前的主题,其中的信息可能已经有所发展或是发生改变。
    今天头脑发热换了个新版的Mysql5.1.59 ,竟然安装不成功了
    ZRY-MBP:mysql zuroyu$ sudo scripts/mysql_install_db
    Installing MySQL system tables...
    OK
    Filling help tables...
    OK

    To start mysqld at boot time you have to copy
    support-files/mysql.server to the right place for your system

    PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
    To do so, start the server, then issue the following commands:

    ./bin/mysqladmin -u root password 'new-password'
    ./bin/mysqladmin -u root -h ZRY-MBP.local password 'new-password'

    Alternatively you can run:
    ./bin/mysql_secure_installation

    which will also give you the option of removing the test
    databases and anonymous user created by default. This is
    strongly recommended for production servers.

    See the manual for more instructions.

    You can start the MySQL daemon with:
    cd . ; ./bin/mysqld_safe &

    You can test the MySQL daemon with mysql-test-run.pl
    cd ./mysql-test ; perl mysql-test-run.pl

    Please report any problems with the ./bin/mysqlbug script!

    ---------

    安装完成

    ---------
    ZRY-MBP:bin zuroyu$ ./mysqladmin -u root password '***'
    ./mysqladmin: connect to server at 'localhost' failed
    error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
    然后一直卡在这sock上了…… 手动touch /tmp/mysql.sock也不好用。
    最后只好通过macports安装,竟然成功了~

    谁了解上面那个问题的原因呢?stackoverflow的答案有手动建立,可惜无效。
    7 条回复    1970-01-01 08:00:00 +08:00
    joyqi
        1
    joyqi  
       2011-11-12 23:43:56 +08:00
    你确认mysql启动了吗
    Kirkcong
        2
    Kirkcong  
       2011-11-12 23:48:54 +08:00
    mamp完全可以全部搞定的啊。。。囧
    zythum
        3
    zythum  
       2011-11-13 00:00:06 +08:00
    @Kirkcong mamp 是个集成环境把。人家不一定用的php,而且mamp的mysql稍微有点悲剧.
    zuroyu
        4
    zuroyu  
    OP
       2011-11-13 00:12:16 +08:00
    @joyqi 貌似启动不了
    111113 00:07:57 mysqld_safe Logging to '/usr/local/mysql/data/ZRY-MBP.local.err'.
    111113 00:07:57 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
    111113 00:07:57 mysqld_safe mysqld from pid file /usr/local/mysql/data/ZRY-MBP.local.pid ended

    @zythum @Kirkcong 嗯 python-mysql
    iwege
        5
    iwege  
       2011-11-13 00:30:34 +08:00
    好像以前遇到过这个问题...

    http://drupal.org/node/184465

    不知道是不是这个问题?
    xi4oh4o
        6
    xi4oh4o  
       2011-11-13 00:50:48 +08:00
    @zuroyu 看看错误日志吧,检查下文件夹权限和运行权限
    victor
        7
    victor  
       2011-11-13 01:01:23 +08:00
    32, 64安装包和命令行略有不同哦
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5374 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 08:45 · PVG 16:45 · LAX 00:45 · JFK 03:45
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.