Reputation: 61
I've set functional laravel project, database connection works, I've added some tables via terminal but now I'd like to see it just as you can see everything with phpmyadmin, for example. How to locate the database file and how to open it, by default?
Upvotes: 3
Views: 5375
Reputation: 12857
In Terminal:
cd into Project directory
vagrant ssh
cd into Project directory in machine
mysql -u[username] -p[password]
- e.g mysql -uhomestead -psecret
Vaala! You are connected to MySQL...
SHOW databases;
USE [Database Name];
- e.g use Homestead;
SHOW TABLES;
to see all tables
SELECT * from [table];
- e.g select * from users
Upvotes: 8
Reputation: 769
Are you using MySQL? If so, you can install the MySQL Workbench and enter the same database credentials to view your data similar to PHPMyAdmin. Alternatively, you can install PHPMyAdmin wherever you are developing (local machine/vagrant/remote). You can also view everything in tabular format with the command line and mysql
as well, but it's not very friendly.
Upvotes: 0