1

i have just create an entity on symfony

i am now trying to create a database using the console command:

 php app/console doctrine:database:create

this generate this error :

     Could not create database for connection named `symfony`

    SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

the /var/run/mysqld/ folder is actually not present in my computer !?

my app/config/parameters.yml :

  parameters:
database_driver:   pdo_mysql
database_host:     localhost
database_port:     ~
database_name:     symfony
database_user:     root
database_password: ~

mailer_transport:  smtp
mailer_host:       localhost
mailer_user:       ~
mailer_password:   ~

locale:            en
secret:            ThisTokenIsNotSoSecretChangeIt

what's wrong ? what did i miss? how can i have access to phpmyadmin on a symfony projet?

Matoeil
  • 6,851
  • 11
  • 54
  • 77

2 Answers2

1

Try localhost instead of 127.0.0.1 to connect in your parameters.yml. Worked for me on a ubuntu pc.

skonsoft
  • 1,786
  • 5
  • 22
  • 43
1

i have solved it by re-sintalling mysql server

  sudo aptitude update sudo aptitude upgrade sudo aptitude install mysql-server 
Matoeil
  • 6,851
  • 11
  • 54
  • 77