start MySQL server from command line on Mac OS Lion

前端 未结 14 1446
名媛妹妹
名媛妹妹 2020-11-30 16:22

I installed mySQL for my Mac. Beside starting the SQL server with mySQL.prefPane tool installed in System Preference, I want to know the instruction to start from command-li

14条回答
  •  再見小時候
    2020-11-30 16:51

    Try /usr/local/mysql/bin/mysqld_safe

    Example:

    shell> sudo /usr/local/mysql/bin/mysqld_safe
    (Enter your password, if necessary)
    (Press Control-Z)
    shell> bg
    (Press Control-D or enter "exit" to exit the shell)
    

    You can also add these to your bash startup scripts:

    export MYSQL_HOME=/usr/local/mysql
    alias start_mysql='sudo $MYSQL_HOME/bin/mysqld_safe &'
    alias stop_mysql='sudo $MYSQL_HOME/bin/mysqladmin shutdown'
    

提交回复
热议问题