Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 07/02/2015, à 11:24

Tuttle

Wordpress 4.1 en local, Erreur de connexion à la BDD MySQL [Résolu]

Bonjoir,

Bon, le message d'erreur n'a pas l'air si rare que ça, mais je n'ai pas réussit à trouver la solution sur le forum.

"Erreur lors de la connexion à la base de données" Lorsque je tape dans mon firefox "http://localhost/wordpress/"

J'ai installé mon site wordpress 4.1 en local (dans var/www/html/).
En suivant des tuto,j'ai pu faire fonctionner le Wordpress en local, avec les mises à jour et tout, top quoi. Hier, tout marchait.

Mais woilà que ce satané message me bloque.

Voici mes quelques essais pour résoudre le souci :

mathieu@mathieu-Akoya-P6647:/var/run/mysqld$ mysql -u root -p
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Je suis sûr du mot de passe, c'est celui qui est dans le fichier wordpress wp-config.php

Ensuite, j'ai vu cette page internet : http://ubuntulesjours.free.fr/?p=382
J'ai donc essayé...

mathieu@mathieu-Akoya-P6647:/var/run/mysqld$ ls -l /var/run/
total 52
drwxr-xr-x 2 mysql      mysql        40 févr.  7 08:32 mysqld
mathieu@mathieu-Akoya-P6647:/var/run/mysqld$ sudo mkdir /var/run/mysqld
mkdir: impossible de créer le répertoire «/var/run/mysqld»: Le fichier existe
mathieu@mathieu-Akoya-P6647:/var/run/mysqld$ sudo chown mysql:mysql mysqld
chown: impossible d'accéder à «mysqld»: Aucun fichier ou dossier de ce type
mathieu@mathieu-Akoya-P6647:/var/run/mysqld$ sudo mysqld_safe
150207 09:38:44 mysqld_safe Can't log to error log and syslog at the same time.  Remove all --log-error configuration options for --syslog to take effect.
150207 09:38:44 mysqld_safe Logging to '/var/log/mysql/error.log'.
150207 09:38:44 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150207 09:38:46 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

Mais rien ne s'écrit dans ce dossier.

La commande pour démarrer mysql avec l'utilisateur mysql ne marche pas non plus :

mathieu@mathieu-Akoya-P6647:/var/run/mysqld$ mysql -u mysql -p
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Voici d'autres commande que j'ai essayé :

mathieu@mathieu-Akoya-P6647:/var/run/mysqld$ sudo /etc/init.d/mysql start
 * Starting MySQL database server mysqld
mathieu@mathieu-Akoya-P6647:~$ rlwrap -a mysql -uroot -p
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
mathieu@mathieu-Akoya-P6647:~$ sudo service mysql start
[sudo] password for mathieu: 
start: Job failed to start
mathieu@mathieu-Akoya-P6647:~$ /etc/init.d/mysql start
df: '/var/lib/mysql/.': Permission denied
 * /etc/init.d/mysql: ERROR: The partition with /var/lib/mysql is too full!
mathieu@mathieu-Akoya-P6647:~$ sudo /etc/init.d/mysql start
[sudo] password for mathieu: 
 * Starting MySQL database server mysqld                                                                                               [fail]

Voici ce qu'il y a dans mon fichier etc/mysql/my.cnf :

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
# 
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port		= 3306
socket		= /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket		= /var/run/mysqld/mysqld.sock
nice		= 0

[mysqld]
#
# * Basic Settings
#
user		= mysql
pid-file	= /var/run/mysqld/mysqld.pid
socket		= /var/run/mysqld/mysqld.sock
port		= 3306
basedir		= /usr
datadir		= /var/lib/mysql
tmpdir		= /tmp
lc-messages-dir	= /usr/share/mysql
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address		= 127.0.0.1
#
# * Fine Tuning
#
key_buffer		= 16M
max_allowed_packet	= 16M
thread_stack		= 192K
thread_cache_size       = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover         = BACKUP
#max_connections        = 100
#table_cache            = 64
#thread_concurrency     = 10
#
# * Query Cache Configuration
#
query_cache_limit	= 1M
query_cache_size        = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file        = /var/log/mysql/mysql.log
#general_log             = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Here you can see queries with especially long duration
#log_slow_queries	= /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
#server-id		= 1
#log_bin			= /var/log/mysql/mysql-bin.log
expire_logs_days	= 10
max_binlog_size         = 100M
#binlog_do_db		= include_database_name
#binlog_ignore_db	= include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem



[mysqldump]
quick
quote-names
max_allowed_packet	= 16M

[mysql]
#no-auto-rehash	# faster start of mysql but no tab completition

[isamchk]
key_buffer		= 16M

#
# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/

Rien ne change lorsque je mets "bind-address        = 127.0.0.1" en commentaire

Vous avez remarqué, je suis novice et assez largué sur mon souci...

Dernière modification par Tuttle (Le 07/02/2015, à 15:57)

Hors ligne

#2 Le 07/02/2015, à 12:01

Tuttle

Re : Wordpress 4.1 en local, Erreur de connexion à la BDD MySQL [Résolu]

Bon...
Je viens de redémarrer mon ordinateur, ça remarche.
Si quelqu'un comprends quelque chose, qui puisse être utile à d'autres, qu'il n'hésite pas !
Bisou !

Hors ligne

#3 Le 07/02/2015, à 15:55

Ungars

Re : Wordpress 4.1 en local, Erreur de connexion à la BDD MySQL [Résolu]

Bonjour, l' essentiel c' est que cela refonctionne.
  Peux tu par contre passer ton message en résolu ?
  Bonne journée.

Hors ligne

#4 Le 07/02/2015, à 15:58

Tuttle

Re : Wordpress 4.1 en local, Erreur de connexion à la BDD MySQL [Résolu]

Yep ! Ayé !
Bonne journée itou !

Hors ligne