I’m new to using the laravel framework, and I’m struggling in starting my project due to several problems I’ve encountered while setting up. I’m currently using Linux as my command prompt and Xampp for database management. Apparently, I have two MySQLs, one downloaded together with XAMPP and, the other, downloaded on its own. This caused me a lot of confusion. (I’m not sure if the problem is related to that.) Along with the two MySQLs, I also have 2 APACHEs, one dowloaded with XAMPP and, the other, APACHE2. So every time I try serving my laravel project and running xampp, I have to stop both the stand alones apache2 and mysql. How should I go about it? After I had fixed the problem of my XAMPP apache and mysql server not running, this problem popped up. My laravel database won’t show up in my XAMPP and the project itself states that its supposed database is “unknown”, though I had already served the project a few days ago with no problem. I’m thinking it might be because the database was linked to the stand alone mysql (I’m not sure), but the port of my laravel project is already editted through its env file to match XAMPP’s mysql server. How do I fix this?
(https://i.sstatic.net/4jEzx1Lj.png)
(https://i.sstatic.net/cbi9zjgY.png)
current status of phpmyadmin in xampp
I’ve tried asking generative AI but to no avail T – T I also can’t ask my teachers because it’s currently summer break
Andy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
7
Check-1
Ensure that the standalone MySQL and Apache services are stopped and disabled from starting automatically. This will prevent conflicts with XAMPP services.
sudo systemctl stop mysql
sudo systemctl disable mysql
sudo systemctl stop apache2
sudo systemctl disable apache2
Check2
Ensure your Laravel project is configured to use the MySQL server from XAMPP. Edit the .env file in your Laravel project directory with the correct database credentials:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database_name
DB_USERNAME=root
DB_PASSWORD=your_xampp_mysql_password
Check3
Check for any running MySQL or Apache services on windows:
- Press the Windows logo key and type services in the search box.
- Open the Services application. Look for MySQL, MySQL57, Apache2.4,
orsimilar services. - Stop and disable these services if they arerunning to avoid conflicts with XAM
- If you have really set all settings perfectly, I guess the issue is on Laravel cache.
Please clear the configuration cache using the following commands:
php artisan config:cache php artisan config:clear
- Otherwise, please create the necessary database for your Laravel project in phpMyAdmin (accessible via XAMPP). And then, import any existing database structure or data if needed.
1