Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Bastet's avatar

Connecting Laravel to HeidiSQL

I've installed a laravel project and I installed homestead into that project. I'm now trying to connect my laravel project to HeidiSQL.

I thought I was doing fine but I get this error

SQL Error (1049): Unknown database 'laravel-database'

Here is my details on HeidiSQL

Network type: MariaDB or MySQL (TCP/IP)
Library: libmariadb.dll
Hostname/IP: 127.0.0.1
User: homestead
Password: secret
Port: 33060
Database: laravel-database

and this is in my Homestead.yaml file

ip: 192.168.10.12
memory: 2048
cpus: 2
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
    - ~/.ssh/id_rsa
folders:
    -
        map: 'E:\Websites\laravel-app'
        to: /home/vagrant/code
sites:
    -
        map: laravel-app.test
        to: /home/vagrant/code/public
databases:
    - laravel-database
features:
    -
        mariadb: false
    -
        ohmyzsh: false
    -
        webdriver: false
name: laravel-app
hostname: laravel-app
0 likes
11 replies
click's avatar

I don't know Heidi that well but you need to connect to your homestead box first that is located on ip: 192.168.10.12 (first line of your config).

jlrdw's avatar

I don't understand the question isn't HeidiSQL just a front end.

It's not a database.

You can connect MySQL to HeidiSQL.

But laravel has nothing to do with that.

Bastet's avatar

That is what I tried.

did this in details on HeidiSQL

Hostname/IP: 192.168.10.12

but I still got that error

jlrdw's avatar

See my above reply you would connect the same way you connect laravel to mySQL.

It's just a connection string.

Sinnbeck's avatar

I think @bastet is just trying to connect to the database from the Heidisql program.

Mine is set up at work. I'll check my settings tomorrow

Sinnbeck's avatar

Did you set the port on Heidi to 33060? Ip is 127.0.0.1

Edit: oh just saw it in your first post. Nevermind

Sinnbeck's avatar

Can you connect to it using laravel? Did you try to just connect to the default database name homestead

Bastet's avatar

Sorry for only being able to get back to you guys today.

@sinnbeck - looks like I am able to connect to homestead but my database isn't showing up in the "Databases" section. @jlrdw - How would I put Heidi on vagrant?

Bastet's avatar

When I restarted my machine I saw my database show up in HeidiSQL. Not sure why though.

Please or to participate in this conversation.