MySQL Access Error while creating DB during initial installation

59 views
Skip to first unread message

Anirban Majumdar

unread,
Mar 1, 2014, 12:20:21 PM3/1/14
to erpnext-dev...@googlegroups.com
Hi,

I was recently trying to setup a local installation of ERPNext on a Ubuntu 12.04 system. I'm making use of the install_erpnext.py script to install. After the packages install, I'm prompted to enter the root MySQL password. After doing so, more Python dependency modules are installed. Next I get a prompt for the database name. But once I enter it, I get an exception stack which ends with "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock". This seems strange, because all the initial DB stuff went through just fine. 

I've also attached a screenshot of the interaction.

Anything I'm doing wrong here?

Thanks for reading!
Anirban
Screenshot 2014-03-01 22.49.37.png

Pratik Vyas

unread,
Mar 1, 2014, 12:22:53 PM3/1/14
to erpnext-dev...@googlegroups.com
Hi Anirban,
Is the MySQL server running?
Try connecting using mysql client.

> Anything I'm doing wrong here?
>
> Thanks for reading!
> Anirban
>
> --
> Note:
>
> If you are posting an issue,
> 1. We should be able to replicate it at our end. So please give us as much
> information as you can. Please see it from the point of view of the person
> receiving the communication.
> 2. Paste your code at http://pastebin.com or http://gist.github.com and send
> only the URL via email
> 3. For sending images, use http://imgur.com or other similar services. Do
> not send images as attachments. Links are good. Same goes for any file you
> are going to send.
>
> End of Note
> ---
> You received this message because you are subscribed to the Google Groups
> "ERPNext Developer Forum" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to erpnext-developer...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/erpnext-developer-forum/6b772848-acab-4ea7-a830-ad109b45fb77%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.


Thanks,
--
Pratik
erpnext

Anirban Majumdar

unread,
Mar 1, 2014, 12:24:40 PM3/1/14
to erpnext-dev...@googlegroups.com
Hey Pratik,

Thanks for the super fast response.

Yes, the MySQL server is running just fine. I tried logging in just after the running the script, and was able to do so without any problems.

Pratik Vyas

unread,
Mar 1, 2014, 12:44:45 PM3/1/14
to erpnext-dev...@googlegroups.com
Hi Anirban,


On Sat, Mar 1, 2014 at 10:54 PM, Anirban Majumdar
<ani...@windsleeve.com> wrote:
> Hey Pratik,
>
> Thanks for the super fast response.
>
You're welcome :)

> Yes, the MySQL server is running just fine. I tried logging in just after
> the running the script, and was able to do so without any problems.
>

Can you try to make MySQL listen on the domain socket the installer is
trying to use?

Thanks,
--
Pratik
erpnext

Anirban Majumdar

unread,
Mar 1, 2014, 1:10:32 PM3/1/14
to erpnext-dev...@googlegroups.com
Hey Pratik,

This is an ec2 server, so could it be that I might need to open up port # 3306 for this to work? i was thinking that since everything is on the same server, this wouldn't really be required.

let me know whether i should open up the firewall port for mysql, and can I close it after the installation is complete?



Thanks,
--
Pratik
erpnext

--
Note:

If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

End of Note
---
You received this message because you are subscribed to a topic in the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/erpnext-developer-forum/ncyxv7Z-ZrU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAG8U0EnBE98khyy57_xehftpX-dk0EzO1kXkZoDkSygRcUWhOg%40mail.gmail.com.

Pratik Vyas

unread,
Mar 1, 2014, 2:18:05 PM3/1/14
to erpnext-dev...@googlegroups.com
On Sat, Mar 1, 2014 at 11:40 PM, Anirban Majumdar
<ani...@windsleeve.com> wrote:
> Hey Pratik,
>
> This is an ec2 server, so could it be that I might need to open up port #
> 3306 for this to work? i was thinking that since everything is on the same
> server, this wouldn't really be required.
>

Not if it is running on the same machine. Just configure the mysql to
listen on /var/run/mysqld/mysqld.sock (this is a domain socket not a
tcp port) ie add

socket=/var/run/mysqld/mysqld.sock

under the mysqld section in my.conf
> You received this message because you are subscribed to the Google Groups
> "ERPNext Developer Forum" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to erpnext-developer...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/erpnext-developer-forum/CAPDGGWQW9wUOU7oT9v3B4sOFk_wE6_nXHGF%3DJAyCQ0nRdUEBPA%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/groups/opt_out.



--
Pratik
erpnext

Anirban Majumdar

unread,
Mar 2, 2014, 11:36:54 PM3/2/14
to erpnext-dev...@googlegroups.com
hi pratik,

i've already got a socket mapping to "/tmp/mysql.sock". This was done at installation time of mysql quite some time back. is there some way to make the erpnext install script to use that value of socket instead of the "/var/run/..." value?

thanks,
anirban


Anirban Majumdar

unread,
Mar 3, 2014, 5:59:54 AM3/3/14
to erpnext-dev...@googlegroups.com
This turned out to be a problem with Python's mysql driver, whereby it would pickup a default "socket" file. 
I modified the db.py file in the lib/webnotes/db.py to accept another parameter: unix_socket, and set it to the socket file configured in the my.cnf file. and everything works fine now.

Thanks for trying to help out.

>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/erpnext-developer-forum/CAG8U0EnBE98khyy57_xehftpX-dk0EzO1kXkZoDkSygRcUWhOg%40mail.gmail.com.
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>
>
> --
> Note:
>
> If you are posting an issue,
> 1. We should be able to replicate it at our end. So please give us as much
> information as you can. Please see it from the point of view of the person
> receiving the communication.
> 2. Paste your code at http://pastebin.com or http://gist.github.com and send
> only the URL via email
> 3. For sending images, use http://imgur.com or other similar services. Do
> not send images as attachments. Links are good. Same goes for any file you
> are going to send.
>
> End of Note
> ---
> You received this message because you are subscribed to the Google Groups
> "ERPNext Developer Forum" group.
> To unsubscribe from this group and stop receiving emails from it, send an

> To view this discussion on the web visit
--
Pratik
erpnext

--
Note:

If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

End of Note
---
You received this message because you are subscribed to a topic in the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/erpnext-developer-forum/ncyxv7Z-ZrU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to erpnext-developer-forum+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages