Mysqldump Error 2002
Contents |
log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more error 2002 hy000 can't connect to local mysql server through socket tmp mysql sock 111 about Stack Overflow the company Business Learn more about hiring developers or posting
Error 2002 (hy000): Can't Connect To Local Mysql Server Through Socket '/tmp/mysql.sock' (2) Mac
ads with us Database Administrators Questions Tags Users Badges Unanswered Ask Question _ Database Administrators Stack Exchange is a question and mysqldump got error 2002 cannot connect to local mysql answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask
Check That Mysqld Is Running And That The Socket: '/var/lib/mysql/mysql.sock' Exists!
a question Anybody can answer The best answers are voted up and rise to the top mysql works, mysqldump doesn't up vote 3 down vote favorite 1 I have mysql 5.5 on my ubuntu 12.04 server. This command: mysql -u root -p works perfectly, but this gives me error: mysqldump -u root -p mydb_name > a.sql mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists! when trying to connect In my.cnf file, the socket is set to: socket = /home/mysql/mysql.sock so I have no idea where /var/run/mysqld/mysqld.sock is coming from. Thanks. mysql mysqldump ubuntu share|improve this question asked Jul 12 '13 at 23:23 AliBZ 3041622 Did you verify that there are no other socket directives further down in my.cnf? –Michael - sqlbot Jul 13 '13 at 0:29 yes i did, that is the only one. –AliBZ Jul 13 '13 at 2:25 add a comment| 1 Answer 1 active oldest votes up vote 7 down vote accepted When reading the configuration file, the mysql command line client only reads configuration directives found in the [client] and [mysql] sections, while mysqldump only uses configuration directives found in the [client] and [mysqldump] sections. If your socket directive in the config file is in the [mysql] section but not the [mysqldump] section then you should move it to the [client] section, and this should solve your problem. So where does /var/run/mysqld/mysqld.sock come from? I remember very distinctly, once upon a time, beating my head against the wall repeatedly over that one. It turns out, Ubuntu compiles their MySQL components from source, and when they do that, they compile them to use /
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies
Error 2003 (hy000): Can't Connect To Mysql Server On '127.0.0.1' (111)
of this site About Us Learn more about Stack Overflow the company
Mysqld.sock Missing
Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges error: 'can't connect to local mysql server through socket '/var/run/mysqld/mysqld.sock' (2)' Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: http://dba.stackexchange.com/questions/46296/mysql-works-mysqldump-doesnt Sign up mysql works, mysqldump doesn't up vote 0 down vote favorite I have mysql 5.5 on my ubuntu 12.04 server. This command: mysql -u root -p works perfectly, but this gives me error: mysqldump -u root -p mydb_name > a.sql mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect In my.cnf file, http://stackoverflow.com/questions/17625370/mysql-works-mysqldump-doesnt the socket is set to: socket = /home/mysql/mysql.sock so I have no idea where /var/run/mysqld/mysqld.sock is coming from. Thanks. mysql ubuntu-12.04 mysqldump share|improve this question asked Jul 12 '13 at 23:15 AliBZ 1,74832648 Do you have more than one copy of the MySQL tools on your system? Is it possible that you're invoking a copy of mysqldump from a different installation (and therefore which is reading different configuration files/using different default settings) to mysql? –eggyal Jul 13 '13 at 0:12 Hi, no it is not possible. I just installed ubuntu server and installed mysql once after. –AliBZ Jul 13 '13 at 0:14 add a comment| 2 Answers 2 active oldest votes up vote 2 down vote accepted NOTE: serverfault.com may arguably be a better place to ask this question as it is related to server configuration rather than programming. First, try adding --socket=/home/mysql/mysql.sock to your mysqldump command. If this works you can make this command line option more persistent and avoid typing it every time by adding it to an option file. Running mysqldump --help will show you (starting at
Get Kubuntu Get Xubuntu Get Lubuntu Get UbuntuStudio Get Mythbuntu Get Edubuntu Get Ubuntu-GNOME Get UbuntuKylin Ubuntu Code of Conduct Ubuntu Wiki Community Wiki Other Support Launchpad Answers Ubuntu IRC Support AskUbuntu Official Documentation User Documentation Social Media https://ubuntuforums.org/showthread.php?t=804021 Facebook Twitter Useful Links Distrowatch Bugs: Ubuntu PPAs: Ubuntu Web Upd8: Ubuntu OMG! Ubuntu Ubuntu Insights Planet Ubuntu Activity Page Please read before SSO login Advanced Search Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk [SOLVED] MySQL ERROR 2002 (HY000): Can't connect to local... Having an Issue With Posting ? Do you want to help us debug the posting issues ? < is the place to report it, thanks ! connect to Page 1 of 5 123 ... Last Jump to page: Results 1 to 10 of 50 Thread: MySQL ERROR 2002 (HY000): Can't connect to local... Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode May 23rd, 2008 #1 sevenearths View Profile View Forum Posts Private Message Visit Homepage Gee! These Aren't Roasted! Join Date Feb 2008 Location Swansea Beans 144 DistroUbuntu 9.04 Jaunty Jackalope can't connect to MySQL ERROR 2002 (HY000): Can't connect to local... I upgraded to 8.04 recently and during the upgrade process Ubuntu asked me if I wanted to change one of my mysql configuration files and I must have clicked yes which is why I am in a bit of a pickle now. I currently get the following when I try to log in: Code: arthur@localhost:/etc/mysql$ mysql -u root -p Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) And my /etc/mysql/my.cnf is as follows: Code: # # The MySQL database server configuration file. # # You can copy this to one of: # - "/etc/mysql/my.cnf" to set global options, # - "~/.my.cnf" to set user-specific options. # # One can use all long options that the program supports. # Run program with --help to get a list of available options and with # --print-defaults to see which it would actually understand and use. # # For explanations see # http://dev.mysql.com/doc/mysql/en/server-system-variables.html # This will be passed to all mysql clients # It has been reported that passwords should be enclosed with ticks/quotes # escpecially if they contain "#" chars... # Remember to edit /etc/mysql/debian.cnf when changing the socket location. [client] port = 3306 socket = /var/run/mysqld/mysqld.sock # Here is entries for some specific programs # The following values assume you