Foros del Web » Programando para Internet » PHP »

Problema Laravel 4 Migraciones

Estas en el tema de Problema Laravel 4 Migraciones en el foro de PHP en Foros del Web. Buenos días, Primero que todo, pedir disculpas si este post no va en esta sección pero no encontré ninguna parecida. Mi problema es que al ...
  #1 (permalink)  
Antiguo 03/11/2014, 08:48
 
Fecha de Ingreso: junio-2014
Mensajes: 50
Antigüedad: 9 años, 10 meses
Puntos: 1
Problema Laravel 4 Migraciones

Buenos días,

Primero que todo, pedir disculpas si este post no va en esta sección pero no encontré ninguna parecida.

Mi problema es que al intentar hacer las migraciones con Laravel 4 en la terminal del mac me aparece esto:

MacBook-Pro-de-Alejandro:curso alejandro$ sudo php artisan migrate:make users
Created Migration: 2014_11_02_203915_users
Generating optimized class loader
Compiling common classes
Compiling views

//Es decir, que la creación de la nueva tabla me la hace en la carpeta "migrations".
//Sin embargo, cuando la quiero migrar a MAMP para que se vea en phpMyAdmin:



MacBook-Pro-de-Alejandro:curso alejandro$ sudo php artisan migrate
**************************************
* Application In Production! *
**************************************

Do you really wish to run this command? y



[PDOException]
SQLSTATE[HY000] [1044] Access denied for user ''@'localhost' to database 'c
ursolaravel4'



migrate [--bench[="..."]] [--database[="..."]] [--force] [--path[="..."]] [--package[="..."]] [--pretend] [--seed]





Alguien me puede ayudar?

Muchisimas gracias! =)
  #2 (permalink)  
Antiguo 03/11/2014, 09:23
Avatar de hhs
hhs
Colaborador
 
Fecha de Ingreso: junio-2013
Ubicación: México
Mensajes: 2.995
Antigüedad: 10 años, 9 meses
Puntos: 379
Respuesta: Problema Laravel 4 Migraciones

ya configuraste la conexión a la base de datos en: app/config/database.php ?
http://laravel.com/docs/4.2/database
__________________
Saludos
About me
Laraveles
A class should have only one reason to change.
  #3 (permalink)  
Antiguo 03/11/2014, 09:37
 
Fecha de Ingreso: junio-2014
Mensajes: 50
Antigüedad: 9 años, 10 meses
Puntos: 1
Respuesta: Problema Laravel 4 Migraciones

Si
Database: cursolaravel4
User: localhost
  #4 (permalink)  
Antiguo 03/11/2014, 10:31
Avatar de hhs
hhs
Colaborador
 
Fecha de Ingreso: junio-2013
Ubicación: México
Mensajes: 2.995
Antigüedad: 10 años, 9 meses
Puntos: 379
Respuesta: Problema Laravel 4 Migraciones

Puedes publicar como esta la configuración en tu archivo database.php, ya que el mensaje de error es por que no estas enviando el usuario en la autenticación.
P.D. No debes usar la palabra "localhost" como usuario ya que es una palabra reservada.
__________________
Saludos
About me
Laraveles
A class should have only one reason to change.
  #5 (permalink)  
Antiguo 03/11/2014, 14:27
 
Fecha de Ingreso: junio-2014
Mensajes: 50
Antigüedad: 9 años, 10 meses
Puntos: 1
Respuesta: Problema Laravel 4 Migraciones

Perdona la tardanza, estaba en clases.

Ya he modificado el nombre por 'roto'

este es el archivo database.php:


<?php

return array(

/*
|--------------------------------------------------------------------------
| PDO Fetch Style
|--------------------------------------------------------------------------
|
| By default, database results will be returned as instances of the PHP
| stdClass object; however, you may desire to retrieve records in an
| array format for simplicity. Here you can tweak the fetch style.
|
*/

'fetch' => PDO::FETCH_CLASS,

/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/

'default' => 'mysql',

/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/

'connections' => array(

'sqlite' => array(
'driver' => 'sqlite',
'database' => __DIR__.'/../database/production.sqlite',
'prefix' => '',
),

'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'cursolaravel4',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),

'pgsql' => array(
'driver' => 'pgsql',
'host' => 'localhost',
'database' => 'forge',
'username' => 'forge',
'password' => '',
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
),

'sqlsrv' => array(
'driver' => 'sqlsrv',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => '',
'prefix' => '',
),

),

/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/

'migrations' => 'migrations',

/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/

'redis' => array(

'cluster' => false,

'default' => array(
'host' => '127.0.0.1',
'port' => 8889,
'database' => 'cursolaravel4',
),

),

);






MUCHISIMAS GRACIAS POR TODO.
  #6 (permalink)  
Antiguo 03/11/2014, 17:31
Avatar de hhs
hhs
Colaborador
 
Fecha de Ingreso: junio-2013
Ubicación: México
Mensajes: 2.995
Antigüedad: 10 años, 9 meses
Puntos: 379
Respuesta: Problema Laravel 4 Migraciones

ya que hiciste el cambio te sigue enviando el mismo error ? por que con esos datos ya te debe de permitir conectarte a mysql
__________________
Saludos
About me
Laraveles
A class should have only one reason to change.
  #7 (permalink)  
Antiguo 04/11/2014, 07:17
 
Fecha de Ingreso: junio-2014
Mensajes: 50
Antigüedad: 9 años, 10 meses
Puntos: 1
Respuesta: Problema Laravel 4 Migraciones

Ahora me sale el siguiente error:

MacBook-Pro-de-Alejandro:curso alejandro$ sudo php artisan migrate
**************************************
* Application In Production! *
**************************************

Do you really wish to run this command? y



[PDOException]
SQLSTATE[HY000] [2002] No such file or directory



migrate [--bench[="..."]] [--database[="..."]] [--force] [--path[="..."]] [--package[="..."]] [--pretend] [--seed]
  #8 (permalink)  
Antiguo 04/11/2014, 09:47
Avatar de hhs
hhs
Colaborador
 
Fecha de Ingreso: junio-2013
Ubicación: México
Mensajes: 2.995
Antigüedad: 10 años, 9 meses
Puntos: 379
Respuesta: Problema Laravel 4 Migraciones

vaya, creo que tienes problemas con MAMP, revisa este post: http://stackoverflow.com/questions/1...le-or-director
__________________
Saludos
About me
Laraveles
A class should have only one reason to change.
  #9 (permalink)  
Antiguo 04/11/2014, 14:46
 
Fecha de Ingreso: junio-2014
Mensajes: 50
Antigüedad: 9 años, 10 meses
Puntos: 1
Respuesta: Problema Laravel 4 Migraciones

Muchas gracias! lo probaré y la semana que viene te informo que estaré una semana ocupado! muchiiisimas gracias! =)

Etiquetas: laravel, sql, tabla
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:58.