Question: ```
mysql -uroot -proot

```

This is the error I get:

> 
> mysql: [Warning] Using a password on the command line interface can be
>  insecure. ERROR 1698 (28000): Access denied for user
>  'root'@'localhost'
> 
> 
>

Answer: 
Here is the solution of the problem i was facing:

The hosts file on local has no edit permission and that's why on setting up the vagrant i.e vagrant up the vagrant ip from config.yml/ default.config.yml file was not being copied to local hosts file.

So i did:  

 1. Go outside vagrant. 
 2. sudo vim /etc/hosts
 3. Copy the vagrant\_ip of config.yml/default.config.yml file present for your particular project.
 4. edit the hosts file and add ip address and alias url of the project.

That's all we are done.
I guess it depends of your 'image'.
If you are connecting via SSH you can also try to login without a password

```
mysql -u root

```

I am using scotch-box vagrant image and works for me (note that the connections made by my php scripts requires the root user password).