I'm completely new to Laravel (and relatively new to PHP in general) and I've been working through Jeff's Laravel 5 intro series. So far so good, using SQLite as per the videos. However, I have a pre-existing MySQL database that I'd like to use as well (or rather, instead). But I have no idea how to actually set it up in Laravel/Homestead.
Ideally I'd like to eventually export my existing database (currently just administered through XAMPP in Windows), import it into my Homestead VM and go from there, but I don't even know how to get going with MySQL in the first place to test things out. Can you help?
The example above uses the standard login credentials for homestead, if you didn't change them this should work. Also not the that you need to replace myDatabase with your database name
If you open your config/database.php you can see the keywords that are defined above. Make sure you have the database driver set to mysql instead of sqlite
Thanks for the quick reply. Do I have to create the database from the MySQL command line first? I can't seem to actually start MySQL from the command line as it happens, I just get an error:
ERROR 1045 (28000): Access denied for user 'vagrant'@'localhost' (using password: NO)
Actually I was just about to ask about using Tinker, but then I heard Jeff's voice in my head, Obi-Wan Kenobi-like, and just used the same syntax as the videos. I realised it doesn't matter what kind of database it is because Tinker just uses the model as the interface (or something like that).
That's right, connections to DBMS (database management systems) are 'interfaced' in your database.php config file and you just need to make sure you have the driver installed as well as uncommented in your php.ini file :)