scotch-io / scotch-box

Scotch Box is a preconfigured Vagrant Box with a full array of LAMP Stack features to get you up and running with Vagrant in no time.
http://box.scotch.io
2.7k stars 547 forks source link

Failed to Connect to MySQL at 127.0.0.1:3306 with user root #380

Open 0xmaayan opened 6 years ago

0xmaayan commented 6 years ago

Having this problem when trying to connect to the database.

screen shot 2018-07-04 at 19 02 08

SSH Password: vagrant Password: root

This is the vagrant file -

`

 Vagrant.configure("2") do |config|
 config.vm.box = "scotch/box"
 config.vm.network "private_network", ip: "192.168.33.10"
 config.vm.hostname = "scotchbox"
 config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]

 config.ssh.username = "vagrant"
 config.ssh.password = "vagrant"    

 # Optional NFS. Make sure to remove other synced_folder line too
 #config.vm.synced_folder ".", "/var/www", :nfs => { :mount_options => ["dmode=777","fmode=666"] 
 } 
end`

using mac.

Does anybody know what can be the problem?

whatnickcodes commented 6 years ago

Can you do vagrant ssh-config and try to connect with those settings

0xmaayan commented 6 years ago

Hey, thanks for the replay.

What should I change?

screen shot 2018-07-06 at 17 57 55
0xmaayan commented 6 years ago

maybe this error message can help -

screen shot 2018-07-07 at 11 18 57

Also, when trying connect to mysql from ssh I get this error -

screen shot 2018-07-07 at 11 24 50
0xmaayan commented 6 years ago

Found the problem.

I deleted the entry of scotchbox on the known_hosts file.

FalaiTio commented 4 years ago

Encontrei o problema.

Eu apaguei a entrada do scotchbox no arquivo known_hosts.

How did you solve it? I have the same problem.

$ vagrant ssh-config
Host default
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile D:/tio/.vagrant/machines/default/virtualbox/private_key
  IdentitiesOnly yes
  LogLevel FATAL

vagrant ssh is ok mysql -u root -p -h localhost -P 3306 is ok phpmyadmin is ok

workbench not connect tunel ssh.

FalaiTio commented 4 years ago

I'm deleting known_hosts solved