0

I am new to the whole thing of php and laravel. I followed a tuto on internet. and I was trying to create table named "links", but, I got this error:

[PDOException]
SQLSTATE[HY000] [1049] Unknown database 'createlinkstable'

this is the file "database.php":

<?php

return [

'fetch' => PDO::FETCH_OBJ,

'default' => env('DB_CONNECTION', 'mysql'),

'connections' => [

    'sqlite' => [
        'driver' => 'sqlite',
        'database' => env('DB_DATABASE', database_path('database.sqlite')),
        'prefix' => '',
    ],

    'mysql' => [
        'driver' => 'mysql',
        'host' => env('DB_HOST', '127.0.0.1'),
        'port' => env('DB_PORT', '3306'),
        'database' => env('DB_DATABASE', 'CreateLinksTable'),
        'username' => env('DB_USERNAME', 'root'),
        'password' => env('DB_PASSWORD', ''),
        'charset' => 'utf8',
        'collation' => 'utf8_unicode_ci',
        'prefix' => '',
        'strict' => true,
        'engine' => null,
    ],


],

'migrations' => 'migrations',

'redis' => [

    'cluster' => false,

    'default' => [
        'host' => env('REDIS_HOST', '127.0.0.1'),
        'password' => env('REDIS_PASSWORD', null),
        'port' => env('REDIS_PORT', 6379),
        'database' => 0,
    ],
],

];

and this is the file ".env"

APP_ENV=local
APP_KEY=*******
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=CreateLinksTable
DB_USERNAME=root
DB_PASSWORD=

It's when I try to execute this command "php artisan migrate" that I got the error bellow

Should I create the database CreateLinksTable manually? If yes,how?

N.B: I am using easyphp

enter image description here

I was reading this post, but it's not helping (Access denied for user 'homestead'@'localhost' (using password: YES))

Cœur
  • 37,241
  • 25
  • 195
  • 267
Naj
  • 119
  • 1
  • 2
  • 13
  • 2
    People, please learn how PHP and MySQL works before working with Laravel... Yes you need to create that database, you can with `phpmyadmin` and I dont think that `CreateLinksTable` should be a databse.. its more like laravel migration name... – Danielius Jan 12 '17 at 15:17
  • Thanks for your answer. In fact, the problem I was facing is that I couldn't access phpmyadmin to create database (127.0.0.1/phpmyadmin) wasn't working so instead I used (http://127.0.0.1/eds-modules/phpmyadmin4531x161221110224/index.php ) this post helped me a lot : (http://stackoverflow.com/questions/35505761/easyphp-devserver-16-1-phpmyadmin) – Naj Jan 12 '17 at 15:40

0 Answers0