Connect to MySQL using Sequel Pro when there is already a MySQL in local


#1

I want to connect to the database via Sequel Pro so I read this page:

and entered all the information.

I get access denied error and I think it is because I have another MySQL running on local machine. I have installed PHP and MySQL on my mac, can this cause an issue while connecting to MySQL?


#2

No, a local installation of MySQL should not conflict with connecting to MySQL on a Vagrant box. Did you configure Sequel Pro to use SSH? Did you double check the username, password, database name, etc. ?


#3

One variation to try, compared to the docs you linked, is
SSH Host: 127.0.0.1
instead of example.dev
(for connections to VM only, of course).

You might also verify the SSH Port setting matches the port displayed when you run
vagrant ssh-config
(could compare other config in that output as well)


#4

@fullyint
I confirmed that they match the output:

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

here is the screenshot from Sequel Pro:

I can’t recall creating a example_com username, I did a search through the entire trellis folder and I couldn’t find this, was this set by default?


#5

aha, the username was wrong,
I got the username and password from site/.env and I was able to connect.
sorry for the stupid mistake, still trying to learn the workflow :stuck_out_tongue:


#6

Good job getting it figured out!

When you run vagrant up or vagrant provision, the wordpress-install role will create the .env file on the VM in a directory that is synced to your local machine site/.env.

Thus the DB_USER in .env will be created from the db_user in your group_vars/development/wordpress_sites.yml file if defined (it’s optional), else will default to example_com, or whateverdomain_com (any dots replaced with underscores).

The DB_PASSWORD in .env will be created from the db_password in group_vars/development/vault.yml.


Development environment / auth_salt