hberenturk Posted May 28, 2012 Share Posted May 28, 2012 Hi , I have a problem in the 3rd step of prestashop installation , even I created a database before i started installation when i enter my database server name , name , login and password correctly there is an error occurs 'Database server was not found, please verify the login, password and server fields' .How can i fix this problem ? Any answer is welcome. Link to comment Share on other sites More sharing options...
MEG Venture Posted May 28, 2012 Share Posted May 28, 2012 Does your mySql server allow external connections? Link to comment Share on other sites More sharing options...
hberenturk Posted May 28, 2012 Author Share Posted May 28, 2012 Does your mySql server allow external connections? How can i understand this ? Link to comment Share on other sites More sharing options...
MEG Venture Posted May 28, 2012 Share Posted May 28, 2012 You can either check using your cPanel or ask to your hosting provider... Link to comment Share on other sites More sharing options...
hberenturk Posted May 28, 2012 Author Share Posted May 28, 2012 so do you think that is it the only problem about confuguration ? it seems that mysql server allows external connections.. Link to comment Share on other sites More sharing options...
MEG Venture Posted May 28, 2012 Share Posted May 28, 2012 If it is not, it is probably a misconfiguration. You can try to test database connection using below code: <?php $con = mysql_connect("localhost","peter","abc123"); if (!$con) { die('Could not connect: ' . mysql_error()); } // some code ?> Link to comment Share on other sites More sharing options...
hberenturk Posted May 28, 2012 Author Share Posted May 28, 2012 This is my first time to use prestashop and mysql ,so i can not say that i'm so experienced , what should i do exactly to test this php code? this is really urgent step that i have to fix it .. Link to comment Share on other sites More sharing options...
MEG Venture Posted May 29, 2012 Share Posted May 29, 2012 Build a php file with the above contents I provided. Change the MySql connection info in it like pass, username. Copy it t to the root via ftp and try to call that file. Then see whether you can connect or not. If not, you will see an error. Share that error here and we'll take a look at it. Link to comment Share on other sites More sharing options...
hberenturk Posted May 29, 2012 Author Share Posted May 29, 2012 Build a php file with the above contents I provided. Change the MySql connection info in it like pass, username. Copy it t to the root via ftp and try to call that file. Then see whether you can connect or not. If not, you will see an error. Share that error here and we'll take a look at it. I created the php file change the content according to my information and put it to the root by ftp.Question is how can i call this file and see the error ? Link to comment Share on other sites More sharing options...
MEG Venture Posted May 29, 2012 Share Posted May 29, 2012 (edited) www.yourdomainname.com/your_sql_check_file.php Edited May 29, 2012 by Caglar (see edit history) Link to comment Share on other sites More sharing options...
hberenturk Posted May 29, 2012 Author Share Posted May 29, 2012 (edited) the warning is like that 'Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /mnt/webg/d2/46/52991846/htdocs/prestashop/testest.php on line 3 Could not connect: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)' it seems that my information does not match but i filled out all the infos are correctly.. Edited May 29, 2012 by hberenturk (see edit history) Link to comment Share on other sites More sharing options...
Scotty501 Posted May 29, 2012 Share Posted May 29, 2012 Can you post what details you are putting in - a screenshot would be useful too. Normally this is because people dont put in the details correctly. Is it a Windows server ? Linux? Local installation on your PC? Link to comment Share on other sites More sharing options...
MEG Venture Posted May 29, 2012 Share Posted May 29, 2012 (edited) When connecting to a MySQL server located on the local system, the mysql client connects thorugh a local file called a socket instead of connecting to the localhost loopback address 127.0.0.1. Instead of copying and pasting the solution here is a summary to fix that: http://www.tech-reci...t-tmpmysqlsock/ Implement the fix after the line "To make your life easier, you..." Please update the forum about the result. Edited May 29, 2012 by Caglar (see edit history) Link to comment Share on other sites More sharing options...
hberenturk Posted May 29, 2012 Author Share Posted May 29, 2012 (edited) Can you post what details you are putting in - a screenshot would be useful too. Normally this is because people dont put in the details correctly. Is it a Windows server ? Linux? Local installation on your PC? its a windows server .I tried to acces from localhost also but both of the cases there are errors. I tried all the possibilities instead of localhost i wrote 127.0.0.1 also changed the database type the result does not change.. When connecting to a MySQL server located on the local system, the mysql client connects thorugh a local file called a socket instead of connecting to the localhost loopback address 127.0.0.1. Instead of copying and pasting the solution here is a summary to fix that: http://www.tech-reci...t-tmpmysqlsock/ Implement the fix after the line "To make your life easier, you..." Please update the forum about the result. In here it seems that there is no mysql.sock file , I searched but i couldnt find it.Maybe this is the source of the problem.. Edited June 6, 2012 by hberenturk (see edit history) Link to comment Share on other sites More sharing options...
MEG Venture Posted May 29, 2012 Share Posted May 29, 2012 (edited) Yes, it is about the mysql.sock file. The error you get, clearly states that. If you can't locate the file yourself, I suggest you to ask to your hosting service provider. Edited May 29, 2012 by Caglar (see edit history) Link to comment Share on other sites More sharing options...
hberenturk Posted May 29, 2012 Author Share Posted May 29, 2012 I got it.. but I dont have a hosting provider yet, documents are located in my computer now. Any other suggestions? Link to comment Share on other sites More sharing options...
MEG Venture Posted May 29, 2012 Share Posted May 29, 2012 (edited) Can you change the test file like below: <?php $con=MySQLdb.connect(user=”peter”,passwd="abc123",db=”yourdatabase_name”,unix_socket=”/opt/lampp/var/mysql/mysql.sock”); if (!$con) { die('Could not connect: ' . mysql_error()); } // some code ?> and tell me the result? Edited May 29, 2012 by Caglar (see edit history) Link to comment Share on other sites More sharing options...
MEG Venture Posted May 29, 2012 Share Posted May 29, 2012 BTW, have you started MySQL? If it's already up and running, check /usr/local/etc/my.cnf to see where the socket is located. By default, it is /tmp/mysql.sock. Link to comment Share on other sites More sharing options...
hberenturk Posted May 29, 2012 Author Share Posted May 29, 2012 (edited) result is Parse error: syntax error, unexpected '=' in /mnt/webg/d2/46/52991846/htdocs/prestashop/testest.php on line 3 but unix_socket is for linux or ? I'm using windows as i mentioned Edited May 29, 2012 by hberenturk (see edit history) Link to comment Share on other sites More sharing options...
MEG Venture Posted May 29, 2012 Share Posted May 29, 2012 Oh sorry... I guess the only way is to find out where the mysql.sock is lacated. It may depend on the mysql version you use. Link to comment Share on other sites More sharing options...
hberenturk Posted May 29, 2012 Author Share Posted May 29, 2012 Mysql is started and working properly , but in my.cnf i couldnt find sock file so should i upgrade mysql version and how ? Link to comment Share on other sites More sharing options...
MEG Venture Posted May 29, 2012 Share Posted May 29, 2012 No need to upgrade mysql. What about tmp folder? Did you look at there? If you still can't find I suggest to google it for the version of your mysql. Link to comment Share on other sites More sharing options...
hberenturk Posted May 29, 2012 Author Share Posted May 29, 2012 i use xampp for mysql server and php ; in xampp directory there is a tmp but inside of mysql file there is no tmp file. In my.cnf file it writes that ' socket= "C:/xampp/mysql/mysql.sock" ' but in mysql files as i said there is no mysql.sock file.As i know mysql creates mysql.sock automatically am i right or should i copy it to the folder? Link to comment Share on other sites More sharing options...
hberenturk Posted May 29, 2012 Author Share Posted May 29, 2012 Here is the screenshot of my my.cnf file , so i think i should change something inside of this.Is anyone has an idea how can i fix this mysql.sock problem ? Link to comment Share on other sites More sharing options...
MEG Venture Posted May 29, 2012 Share Posted May 29, 2012 As you say, the mysql.sock should be automatically created once your server is up and running. I don't know where it is located but yhe autostart settings socket can be off. Consequently, you may consider to uninstall and reinstall the mysql server. Link to comment Share on other sites More sharing options...
hberenturk Posted May 29, 2012 Author Share Posted May 29, 2012 is there a possible solution without uninstall mysql server? There is no mysql.sock file and i have to fix it by modifying my.ini file as i think but couldnt achieve since now.. can it be related with port crash ? like 1 week im stuck with this problem.. Link to comment Share on other sites More sharing options...
hberenturk Posted May 30, 2012 Author Share Posted May 30, 2012 anyone has an idea how can i fix the mysql.sock problem ? or can somebody say something about, there are some files inside of mysql my.huge , my.large etc. are they related with my.ini ? coz as i understand i should change socket location in my.ini but there are still something missing Link to comment Share on other sites More sharing options...
Suxxess Posted June 3, 2012 Share Posted June 3, 2012 (edited) I think that is not (only) a mysql problem. 1) Download a new package from this site ( They change something in the package in the last two weeks. It's 300 kb bigger as the old version with the same version number ) 2) Don't change something in the mysql configuration 3) Try to take the root account and use it without a password ( For a local testinstallation it should be ok ) If that is possible you can try other settings. Perhaps you can select 127.0.0.1 in the phpmyadmin online menu. I couldn't locate the bug, but I could use the database with this useraccount. Edited June 3, 2012 by Suxxess (see edit history) Link to comment Share on other sites More sharing options...
hberenturk Posted June 5, 2012 Author Share Posted June 5, 2012 I think that is not (only) a mysql problem. 1) Download a new package from this site ( They change something in the package in the last two weeks. It's 300 kb bigger as the old version with the same version number ) 2) Don't change something in the mysql configuration 3) Try to take the root account and use it without a password ( For a local testinstallation it should be ok ) If that is possible you can try other settings. Perhaps you can select 127.0.0.1 in the phpmyadmin online menu. I couldn't locate the bug, but I could use the database with this useraccount. It does not work , i uninstalled prestashop and reinstalled it but result is still same.. I really dont know what is the problem exactly, mysql.sock can not be created but like 10 days i couldnt fix it.. maybe i should use a host provider because in localhost it does not work until now Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now