MySQL Access Error while creating DB during initial installation

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



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-forum+un…@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.

Hi Anirban,

On Sat, Mar 1, 2014 at 10:50 PM, Anirban Majumdar
an...@windsleeve.com wrote:

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.

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-forum+un...@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

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.

On Saturday, March 1, 2014 10:52:53 PM UTC+5:30, Pratik Vyas wrote:
Hi Anirban,

On Sat, Mar 1, 2014 at 10:50 PM, Anirban Majumdar
<an...@windsleeve.com> wrote:
> 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.
>

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-forum+un...@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



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/726b7d1f-6484-45d8-9e64-c7a598ce79ca%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.

Hi Anirban,

On Sat, Mar 1, 2014 at 10:54 PM, Anirban Majumdar
an...@windsleeve.com wrote:

Hey Pratik,

Thanks for the super fast response.

You’re welcome :slight_smile:

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

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?


On Sat, Mar 1, 2014 at 11:14 PM, Pratik Vyas <pd...@gmail.com> wrote:
Hi Anirban,


On Sat, Mar 1, 2014 at 10:54 PM, Anirban Majumdar
<an...@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

--
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+un…@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.



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-forum+un…@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.

On Sat, Mar 1, 2014 at 11:40 PM, Anirban Majumdar
an...@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

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

On Sat, Mar 1, 2014 at 11:14 PM, Pratik Vyas pd...@gmail.com wrote:

Hi Anirban,

On Sat, Mar 1, 2014 at 10:54 PM, Anirban Majumdar
an...@windsleeve.com wrote:

Hey Pratik,

Thanks for the super fast response.

You’re welcome :slight_smile:

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


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+un...@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.

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
email to erpnext-developer-forum+un...@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

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


On Sun, Mar 2, 2014 at 12:48 AM, Pratik Vyas <pd...@gmail.com> wrote:
On Sat, Mar 1, 2014 at 11:40 PM, Anirban Majumdar
<an...@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


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

>
> On Sat, Mar 1, 2014 at 11:14 PM, Pratik Vyas <pd...@gmail.com> wrote:
>>
>> Hi Anirban,
>>
>>
>> On Sat, Mar 1, 2014 at 10:54 PM, Anirban Majumdar
>> <an...@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
>>
>> --
>> 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+un...@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.

>>

>> 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
> email to erpnext-developer-forum+un...@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

--
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+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAG8U0EmEiOmWSS7zysFm-4PvwjW3BQcDkmWsJ7O0CLcx_m%3D7aQ%40mail.gmail.com.



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAPDGGWTV8sEnaW0XbssCs2faJEJ21_wJMFnjYFi4p6-wkfFQtQ%40mail.gmail.com.

    For more options, visit https://groups.google.com/groups/opt_out.
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.

On Monday, March 3, 2014 10:06:54 AM UTC+5:30, Anirban Majumdar wrote:
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


On Sun, Mar 2, 2014 at 12:48 AM, Pratik Vyas <pd...@gmail.com> wrote:
On Sat, Mar 1, 2014 at 11:40 PM, Anirban Majumdar
<an...@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


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

>
> On Sat, Mar 1, 2014 at 11:14 PM, Pratik Vyas <pd...@gmail.com> wrote:
>>
>> Hi Anirban,
>>
>>
>> On Sat, Mar 1, 2014 at 10:54 PM, Anirban Majumdar
>> <an...@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
>>
>> --
>> 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+un...@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.

>>

>> 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
> email to erpnext-developer-forum+un...@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

--
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+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAG8U0EmEiOmWSS7zysFm-4PvwjW3BQcDkmWsJ7O0CLcx_m%3D7aQ%40mail.gmail.com.



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-forum+un...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/7cdfd0b9-b019-4102-88fe-080cbb376e4c%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.