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

N16h7h4wk's avatar

SQLSTATE[42S01]: Base table or view already exists ? Install Admin Panel Issue !

Attempting to install Voyager on Laravel 5.4 using the same SQL database as Laravel app.

These are the steps I took for installation:

1: cd /laravel_app

2: composer require tcg/voyager

3: My .env already has my DB credentials

4: My app_url within .env is: APP_URL=http://localhost:8000

5: Since I am running 5.4 I added serviceprovider within config/app.php

    /*
     * Package Service Providers...
     */
    Laravel\Tinker\TinkerServiceProvider::class,
    TCG\Voyager\VoyagerServiceProvider::class,
    /*
     * Application Service Providers...
     */

6: php artisan config:clear (If I don't do this before install I get Voyager command not found and or voyager namespace not a registered class)

7: php artisan voyager:install

This is what follows:

Publishing the Voyager assets, database, and config files Copied Directory [/vendor/tcg/voyager/publishable/assets] To [/public/vendor/tcg/voyager/assets]

Publishing complete.

Copied Directory [/vendor/tcg/voyager/publishable/database/seeds] To [/database/seeds]

Publishing complete.

Publishing complete.

Migrating the database tables into your application

  • Application In Production!     *
    

Do you really wish to run this command? (yes/no) [no]:

yes

In Connection.php line 647:

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'settings' already exists (SQL: create table settings (id int unsigned not null auto_increment primary key, key varchar(191) not null, display_name varchar(191) not null, value text not null, details text null, type varchar(191) not null, order int not null default '1') default character set utf8mb4 collate utf8mb4_unicode_ci)

In PDOStatement.php line 107: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'settings' already exists

In PDOStatement.php line 105: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'settings' already exists

Other things I have tried are:

  • composer update

  • php artisan cache:clear

  • composer dumpautoload

Voyager is visible when I run php artisan

My goal is to use Voyager admin with my Laravel app

Any help is greatly appreciated

0 likes
3 replies
Nakov's avatar

The error is self-explanatory. The database that you are using already contains table named settings. Do you maybe accidentally renamed one of your migrations, or removed the row in the migrations table which creates the settings table so when you run php artisan migrate you get this error? You might wanna start fresh if you don't have any important data in your database.

N16h7h4wk's avatar

Yes, I have important data within the database. I have cloned my Laravel app and DB, so nothing is affected if I run into issues.

I know both Laravel App and voyager are trying to use the same SQL table as settings that is why I see this error, but I can not update to use a prefix such as abcsettings because my laravel app cannot read SQL table if prefix is changed in .env file. It seems easy when you first read the SQL error, yet no workaround.

My next attempt is to export data out of my SQL DB, then delete, install voyager and then dump exported SQL back into DB, I'll post results after.

Please or to participate in this conversation.