Database Engine Options0:01
There are a few different types of databases we can choose to work with when we're working with Laravel Forge. And the options that we're given depend on who the server provider is. So if I create a new server with Laravel VPS, we have the latest version of MySQL and Postgres as our options, which might be just fine for you. If you need more, you may need to create a new server using one
If you need more, you may need to create a new server using one of the traditional VPS providers like Digital Ocean, because when we create a server there, we get MySQL eight, but also all sorts of versions of MariaDB and more versions of Postgres than we would have otherwise. So that's really up to you and your situation about what you're gonna need there. You now can create specific databases on that server in a few different contexts.
Creating Databases in Forge0:41
You now can create specific databases on that server in a few different contexts. First of all, when you create a new site, you can choose to either connect to an existing database like the Stock Forge database, which I would not recommend or create a new database specific for the site you're building. You could just type the name of the project you're working on if you want. You can choose to create a new database, user and password.
on if you want. You can choose to create a new database, user and password. Or when you're at the server level, you can go to storage. And when you see database here, this is where you can configure your actual database. And then down here you can look at the databases on that database. So if we had just created one right there, it would've showed up. Or we can just come in and say,
Managing Database Users1:18
right there, it would've showed up. Or we can just come in and say, create a new database called Tutorial. And again, we can choose to create a new user or just allow it to authenticate with the existing Forge user. Now if you wanna segment the database users that you're using across your sites, you can create a new user in here and then you can give them access to different things.
you can create a new user in here and then you can give them access to different things. So if we wanna say Read only with the password of, well just a generator password, we'd wanna copy this, of course we can say it only has access to one or more databases, and then we can give it Read only access, and we create our user there. And so this way gives you the ability to have a specific user for your database that only has permissions to either certain projects
Editing Database Configuration1:51
to have a specific user for your database that only has permissions to either certain projects or only read access permissions. If you wanna do more advanced configurations, you can actually come in and edit the database configuration file. There's not a lot going on here right now other than just including the default configuration items, but of course you can change and put in your own settings here as well.
Connecting via TablePlus2:08
but of course you can change and put in your own settings here as well. And finally, if you want to connect to your database through something like Table Plus, you can grab this URL, which has everything you need to know about it. ENC code it into a single string and it makes it a lot easier to get it up and running. So you can copy the clipboard, you can go over to Table Plus, and you can say, create Connection import from URL.
to Table Plus, and you can say, create Connection import from URL. It's already got it outta your clipboard. You'd import and then test it. And the only thing that might not work is if you don't have your SSH key set up, you might have to type in the password, but since I have my SSH key added to the server already, it just works by default. Hit save and you can jump right in.
Setting Up Redis Access2:44
it just works by default. Hit save and you can jump right in. Now, forge also installs memc and Redis for us automatically in our servers, and it automatically sets up your dot ENV to have access to them the way you need. So if we were to SSH into a server and take a look at the nv, you can see you've already got your Redis client with the correct authentication information here.
you can see you've already got your Redis client with the correct authentication information here. And if you want to connect that on Table Plus, there is not an easy way to do that just like there was with the URL, but we can just create a new connection and Redis, oops. And this is basically just setting up manually what we had in the other one. So this is, you know, Redis for Oregon Trail Production, and then your server is the IP address of your server.
So this is, you know, Redis for Oregon Trail Production, and then your server is the IP address of your server. The user is Forge, unless you did Site Isolation, no password, just SSH Key. And all of these are just using the defaults. So if you hit test, you're just gonna see it. It'll be right in your Reds database right there. If you want to customize your Reds password, you can. The only setting we have right now is the password. So you're on your server, you go to Settings Redis,
The only setting we have right now is the password. So you're on your server, you go to Settings Redis, and you can set a password so it's not a root, empty password, just like we did right there. But other than that, reds should just work outta the box.
