启动mysql提示符

启动mysql提示符,mysql,ruby-on-rails,terminal,Mysql,Ruby On Rails,Terminal,我正在尝试使用mysql启动一个新的rails项目,但我在使用mysql时遇到了困难。这就是我想做的 Rails new name -d mysql 那我就试试这个 rake db:create 但是它给了我以下的错误 #<Mysql2::Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)> Couldn't create database for {"adapte

我正在尝试使用mysql启动一个新的rails项目,但我在使用mysql时遇到了困难。这就是我想做的

Rails new name -d mysql
那我就试试这个

rake db:create
但是它给了我以下的错误

    #<Mysql2::Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)>
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "pool"=>5, "username"=>"root", "password"=>nil, "host"=>"localhost", "database"=>"biller_development"}, {:charset=>"utf8", :collation=>"utf8_unicode_ci"}
(If you set the charset manually, make sure you have a matching collation)
#<Mysql2::Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)>
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "pool"=>5, "username"=>"root", "password"=>nil, "host"=>"localhost", "database"=>"biller_test"}, {:charset=>"utf8", :collation=>"utf8_unicode_ci"}
(If you set the charset manually, make sure you have a matching collation)
对于mysql提示符,但它说找不到该命令。我安装了mysql 5.6,我有mysql工作台。我该怎么办?任何帮助都将不胜感激


提前感谢

您正在使用什么linux发行版,也许您有mariadb或类似的东西我正在使用Mac Yosemite OSCheck您的mysql安装,然后在
config/database.yml
上匹配您的设置以匹配您的mysql安装。
mysql -uroot