我为Mac安装了mySQL。除了使用System Preference中安装的mySQL.prefPane工具启动SQL Server之外,我还想知道从命令行启动的指令。
我做如下:
后
我通过命令行启动mySQL服务器,它产生如下错误:
请帮我!
编辑:
原因在这里:http://dev.mysql.com/doc/refman/5.5/en/changing-mysql-user.html
下面的xdazz答案中描述了一种解决方案。
最佳答案
试试/usr/local/mysql/bin/mysqld_safe
例:
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)
您还可以将这些添加到bash启动脚本中:
export MYSQL_HOME=/usr/local/mysql
alias start_mysql='sudo $MYSQL_HOME/bin/mysqld_safe &'
alias stop_mysql='sudo $MYSQL_HOME/bin/mysqladmin shutdown'
关于mysql - 在Mac OS Lion上从命令行启动MySQL服务器,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7927854/