partkeepr / PartKeepr

Open Source Inventory Management
http://www.partkeepr.org
GNU General Public License v3.0
1.38k stars 401 forks source link

Please help me I lost all of my data SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) #431

Closed Greatal closed 9 years ago

Greatal commented 9 years ago

Dear partkeepr developer I have problem that almost ruined my day I add a new part and bingo an error pops up I think it is nothing try to restart my partkeepr and relogin but I face this error on login page SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I think it is simple because my virtual machine disk is full I tray to extend it but what ever I do I cant change partion size of LVM drive although I mange to resize the disk the partion remain unchanged and I keep facing same error I just finished entering over 1.5K deferent part to it(it is my personal collection over 1 million parts ) and it is so hard for me to do it again can you please help me to recover my partkeepr hear is the full report of error SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Exception

PDOException

Backtrace

PDOException

Request

{"url":"rest.php/Auth/login","success":null,"failure":null,"method":"POST","params":"{\"username\":\"admin\",\"password\":\"7f16109f1619fd7a733daf5a84c708c1\"}","headers":{"call":"login","lang":"en_US"}}

Response

{"status":"systemerror","success":false,"exception":{"message":"SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '\/var\/run\/mysqld\/mysqld.sock' (2)","exception":"PDOException","backtrace":"#0 \/usr\/share\/php\/Doctrine\/DBAL\/Driver\/PDOConnection.php(36): PDO->construct('mysql:host=loca...', 'partkeepr', 'partkeepr', Array)\n#1 \/usr\/share\/php\/Doctrine\/DBAL\/Driver\/PDOMySql\/Driver.php(47): Doctrine\DBAL\Driver\PDOConnection->construct('mysql:host=loca...', 'partkeepr', 'partkeepr', Array)\n#2 \/usr\/share\/php\/Doctrine\/DBAL\/Connection.php(350): Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, 'partkeepr', 'partkeepr', Array)\n#3 \/usr\/share\/php\/Doctrine\/DBAL\/Connection.php(627): Doctrine\DBAL\Connection->connect()\n#4 \/usr\/share\/php\/Doctrine\/ORM\/Persisters\/BasicEntityPersister.php(670): Doctrine\DBAL\Connection->executeQuery('SELECT t0.id AS...', Array, Array)\n#5 \/usr\/share\/php\/Doctrine\/ORM\/EntityRepository.php(171): Doctrine\ORM\Persisters\BasicEntityPersister->load(Array, NULL, NULL, Array, 0, 1, NULL)\n#6 \/var\/www\/partkeepr-0.1.9\/src\/backend\/PartKeepr\/User\/UserManager.php(95): Doctrine\ORM\EntityRepository->findOneBy(Array)\n#7 \/var\/www\/partkeepr-0.1.9\/src\/backend\/PartKeepr\/Auth\/AuthService.php(73): PartKeepr\User\UserManager->authenticate(Object(PartKeepr\User\User))\n#8 \/var\/www\/partkeepr-0.1.9\/src\/backend\/PartKeepr\/Service\/ServiceManager.php(131): PartKeepr\Auth\AuthService->login()\n#9 \/var\/www\/partkeepr-0.1.9\/frontend\/rest.php(56): PartKeepr\Service\ServiceManager->call()\n#10 {main}"},"timing":0.047731161117554}

Server Configuration

doctrine_orm_version: 2.3.3 doctrine_dbal_version: 2.3.4 doctrine_common_version: 2.3.0 php_version: 5.4.4-14+deb7u4 maxUploadSize: 209715200 availableImageFormats: 3FR,A,AAI,AI,ART,ARW,AVI,AVS,B,BGR,BGRA,BIE,BMP,BMP2,BMP3,BRF,C,CAL,CALS,CANVAS,CAPTION,CIN,CIP,CLIP,CMYK,CMYKA,CR2,CRW,CUR,CUT,DCM,DCR,DCX,DDS,DFONT,DNG,DPX,EPDF,EPI,EPS,EPS2,EPS3,EPSF,EPSI,EPT,EPT2,EPT3,ERF,FAX,FITS,FRACTAL,FTS,G,G3,GIF,GIF87,GRADIENT,GRAY,GROUP4,HALD,HDR,HISTOGRAM,HRZ,HTM,HTML,ICB,ICO,ICON,INFO,INLINE,IPL,ISOBRL,J2C,J2K,JBG,JBIG,JNG,JP2,JPC,JPEG,JPG,JPX,K,K25,KDC,LABEL,M,M2V,M4V,MAC,MAP,MAT,MATTE,MEF,MIFF,MNG,MONO,MOV,MP4,MPC,MPEG,MPG,MRW,MSL,MTV,MVG,NEF,NRW,NULL,O,ORF,OTB,OTF,PAL,PALM,PAM,PATTERN,PBM,PCD,PCDS,PCL,PCT,PCX,PDB,PDF,PDFA,PEF,PES,PFA,PFB,PFM,PGM,PGX,PICON,PICT,PIX,PJPEG,PLASMA,PNG,PNG24,PNG32,PNG8,PNM,PPM,PREVIEW,PS,PS2,PS3,PSB,PSD,PTIF,PWP,R,RADIAL-GRADIENT,RAF,RAS,RGB,RGBA,RGBO,RLA,RLE,SCR,SCT,SFW,SGI,SHTML,SR2,SRF,STEGANO,SUN,TEXT,TGA,THUMBNAIL,TIFF,TIFF64,TILE,TIM,TTC,TTF,TXT,UBRL,UIL,UYVY,VDA,VICAR,VID,VIFF,VST,WBMP,WMV,WPG,X,X3F,XBM,XC,XCF,XPM,XPS,XV,XWD,Y,YCbCr,YCbCrA,YUV

Drachenkaetzchen commented 9 years ago

Yes, the message indicates that MySQL is not running. I'm sorry, but this is not a PartKeepr issue and I'm not able to provide support for debugging why MySQL is not running.

diodenschein commented 9 years ago

So your running the Partkeepr Virtual Machine Image? Or did you install it yourself?

What Os are you running?

Drachenkaetzchen commented 9 years ago

I'm running PartKeepr on Debian, no virtual machine. The Virtual Machine Image is Debian 7.1 as well. You could try asking on http://forums.debian.net/

Greatal commented 9 years ago

Hi Thanks for fast replay is there any way that I could backup data and restore it again in new installation I run partkeepr on vmware using your sample virtualbox file that you provide in you download web page Because it wont run in virtualbox in my computers

diodenschein commented 9 years ago

You should make a copy of the VM first, so when you screw up more you still have something.

You say your file system is full? It might be helpful if you post sth. like

sudo fdisk -l

and or

sudo df

Did you have a look in your log files?

If you don't know where to look: http://www.pontikis.net/blog/how-and-when-to-enable-mysql-logs

Greatal commented 9 years ago

I manage to delete partkeepr from www so now I have empty space and my sql start can anyone help me to back up my database to restore it to another system it was originally partkeepr.ova image from main website I have no Idea for mysql root password and database name and how I have to restore it to another system I would appreciate any help

diodenschein commented 9 years ago

Have a look at

/var/www/partkeepr-$version/config.php

it should contain dbname username and password for that db.

Oh you deleted that, sorry.

It's "partkeepr", all three. Then try:

http://webcheatsheet.com/sql/mysql_backup_restore.php

Greatal commented 9 years ago

Thanks for help actually I have another copy of my hard disk and by deleting only /var/www/partkeepr-0.1.9/data/Temporary only I manage to boot my partkeepr and it seams to username is root and password is blank

Greatal commented 9 years ago

In look in to config.php and find this <?php namespace PartKeepr; use PartKeepr\Util\Configuration;

Configuration::setOption("partkeepr.database.dbname", "partkeepr"); Configuration::setOption("partkeepr.database.username", "partkeepr"); Configuration::setOption("partkeepr.database.password", "partkeepr"); Configuration::setOption("partkeepr.database.host", "localhost"); Configuration::setOption("partkeepr.database.driver", "pdo_mysql");::setOption("partkeepr.database.driver", "pdo_mysql"); It is pretty much it but still I don’t know how to back it up and restore it to another system Can any one provide step by step configuration please My new host is Ubuntu and it seams working although after finishing setup nothing happened it just show my partkeepr folder contents don’t load main page