Giter Club home page Giter Club logo

Comments (5)

felixge avatar felixge commented on August 28, 2024

Thanks for the patches! A few things:

  • Please use pull requests and isolated feature branches (your master also has other stuff in it), makes it much easier for me to review stuff : ).
  • I don't know if this should be in there: Client.SOCKET_PATH = '/var/run/mysqld/mysqld.sock'; Seems like that's just specific to your system, no?
  • Wasn't it possible to do this already by setting port = '/some/socket.sock' ? I'm not saying there shouldn't be an explicit property for it, but I was under the impression that this was already working.
  • When adding a property to an object (self.unixSocket), always add it in the constructor as well. Otherwise future-me is going to have a hard time reasoning about the state and configuration of the Client object.

--fg

--fg

from mysql.

Kijewski avatar Kijewski commented on August 28, 2024
  • Sorry, I'm quite new to Github (and Git for that matter ...). I'll try to learn branching in future. ;)
  • In mysql_version.h MYSQL_UNIX_ADDR in defined as "/var/run/mysqld/mysqld.sock". The path conforms the Filesystem Hierarchy Standard, which Linux and *BSD conforms to. So likely even Mac OSX will have the socket at this path.
  • Yes it was already possible. I only want to suggest to promote this feature as it promises a remarkable performance gain on low and high frequented web applications.
  • You're right. On second thought I'd discourage adding a new parameter. The name port for the socket path should be pretty sufficient as is.

My suggestions collapse to proposing making using the unix socket default.

Regards, René

from mysql.

felixge avatar felixge commented on August 28, 2024

My suggestions collapse to proposing making using the unix socket default.

Hm, I think connecting to localhost:3306 is more common by default, no? But I think I'd like to see a patch that allows:

// Use default: /var/run/mysqld/mysqld.sock
client.socket = true;

Or

client.socket = '/my/custom.sock';

--fg

PS: I'll be on vacation until the 29th, so I won't have a chance to merge anything until then.

from mysql.

dresende avatar dresende commented on August 28, 2024

host = whatever; port = "/path/to/mysqld.sock" seems to work perfectly

from mysql.

felixge avatar felixge commented on August 28, 2024

Use what @dresende for 0.9.x. 2.0.0 now supports this explicitly: 89dd8ab

from mysql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.