cancel
Showing results for 
Search instead for 
Did you mean: 

mysqldump command fail

gdowrey
Champ in-the-making
Champ in-the-making
I have intalled Alfresco Community 3.4.d on an Ubuntu Server 10.04 server using the quick install with the bundled mysql database.  The Ubuntu server only had ssh installed; mysql was not installed.  When I use the mysqldump command:

mysqldump -u root -p –default-character-set=latin1 -N alfresco > backup.sql

I get this error:

mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect

I have discovered that there are two my.cnf files on the server, one at /etc/mysql, and the other at /opt/alfresco-3.4.d/mysql.  Each points to a different mysqld.sock.  The /etc/mysql/my.cnf points to the one referenced in the error message and the other points to /opt/alfresco-3.4.d/mysql/tmp/mysql.sock. 

Where do I need to look to re-direct the mysqldump command to the correct socket?  A search shows two copies of the command, one under /usr/bin the other under /opt/alfresco-3.4.d/mysql/bin.
1 REPLY 1

sjoerdjump
Champ in-the-making
Champ in-the-making
Hi,

I dont think that this is still relevant but here it goes.

I had the same error, but after a couple of hours ( Smiley Sad ) i managed to make the dump.

The mistake i made was this: wit ./opt/alfresco/alfresco.sh stop i also stopped the mysql server.

so, if you stop Alfresco using the script, make sure to restart mysql: ./opt/alfresco/mysql/scripts/ctl.sh start (from memory)
Recently i red somewhere that you can also stop the tomcatserver, but havnt tried this yet.

Also, i replaced /etc/my.cnf with the /opt/alfresco/mysql/my.cnf <- i'm not sure if this is really nececerly… I can imagine that it might muck up mysql as a whole on your server.

Hope this is helpfull for someone.

Cheers.

Sjoerd