₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,567 members, 8,422,603 topics. Date: Monday, 08 June 2026 at 02:08 PM

Toggle theme

Help Needed For My Laravel Program - Webmasters - Nairaland

Nairaland ForumScience/TechnologyWebmastersHelp Needed For My Laravel Program (1175 Views)

1 Reply (Go Down)

Help Needed For My Laravel Program by jwax(op): 3:15pm On Mar 14, 2019
Please webmasters. am working with laravel 5.8 to build a project but am stuck with an error.

I tried migrating my migrations but I got an error (seen below). have tried the conventional fix which is to do

Schema::defaultStringLength(191); and importing the Facades schema (use Illuminate\Support\Facades\Schema; but the error just won't go away.

Please how can I fix this? see error from command prompt below

Migrating: 2014_10_12_000000_create_users_table

Illuminate\Database\QueryException : SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists (SQL: create table `users` (`id` bigint unsigned not null auto_increment primary key, `name` varchar(191) not null, `email` varchar(191) not null, `email_verified_at` timestamp null, `password` varchar(191) not null, `remember_token` varchar(100) null, `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')

at C:\wamp64\www\blog\vendor\laravel\framework\src\Illuminate\Database\Connection.php:664
660| // If an exception occurs when attempting to run a query, we'll format the error
661| // message to include the bindings with SQL, which will make this exception a
662| // lot more helpful to the developer instead of just the database's errors.
663| catch (Exception $e) {
> 664| throw new QueryException(
665| $query, $this->prepareBindings($bindings), $e
666| );
667| }
668|

Exception trace:

1 PDOException:sad"SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists"wink
C:\wamp64\www\blog\vendor\laravel\framework\src\Illuminate\Database\Connection.php:458

2 PDOStatement::execute()
C:\wamp64\www\blog\vendor\laravel\framework\src\Illuminate\Database\Connection.php:458

Please use the argument -v to see more details.
Re: Help Needed For My Laravel Program by resosdigital(m): 3:22pm On Mar 14, 2019
You tried the schemadefaultstringlength after encountering the first error.

Just go to your database using phpmyadim or whatever you use and delete the users table.

Laravel created it when you first ran your migrations but ran into the error before it could create the migrations table so when you try running the migration again, it tries to recreate the users table.

Just delete the users table and you will be fine
Re: Help Needed For My Laravel Program by jwax(op): 12:22pm On Mar 16, 2019
resosdigital:
You tried the schemadefaultstringlength after encountering the first error.

Just go to your database using phpmyadim or whatever you use and delete the users table.

Laravel created it when you first ran your migrations but ran into the error before it could create the migrations table so when you try running the migration again, it tries to recreate the users table.

Just delete the users table and you will be fine
Wow! It worked just as you advised. Thanks alot
Re: Help Needed For My Laravel Program by resosdigital(m): 12:45pm On Mar 16, 2019
jwax:
Wow! It worked just as you advised. Thanks alot
Glad I could help
Re: Help Needed For My Laravel Program by jwax(op): 2:55pm On Mar 16, 2019
resosdigital:
Glad I could help
Thanks a million.
1 Reply

Bulk SMS Website..Help needed!My Site Opendns Issues, Please Help Needed.Learn Laravel From Scratch...234

Having Issue With My Site Payment MethodHow Website Users Read Content On A SiteYour Comments Needed Here