MySQL problem -- ERROR 2002 Can't connect to local MySQL server

Not Sure if this would be a right forum for my problem...
I'm installing mySQL on my iBook, and thought that I have configured it. But then, after followring some instuctions from Adobe and Marc Liyanage sites, I have a problem to connect. This is what I've done in "TERMINAL"
~username$> cd /usr/local/mysql
mysql ~username$> sudo chown -R mysql data/
(asking for admin password)
mysql ~username$> sudo echo
mysql ~username$> sudo ./bin/mysqld_safe &
username-ibook-g4:/usr/local/mysql username$ Starting mysqld daemon with databases from /usr/local/mysql/data
STOPPING server from pid file /usr/local/mysql/data/roshaili-osmans-ibook-g4.local.pid
060611 16:31:30 mysqld ended
mysql ~username> /usr/local/mysql/bin/mysql test
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
[1]+ Done sudo ./bin/mysqld_safe
mysql ~username>
When I typed ::
/usr/local/mysql/bin/mysqladmin -u root
(see that there's no password)
Then it displays:
/usr/local/mysql/bin/mysqladmin Ver 8.41 Distrib 5.0.22, for apple-darwin8.6.0 on powerpc
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
Administration program for the mysqld daemon.
Usage: /usr/local/mysql/bin/mysqladmin [OPTIONS] command command....
-c, --count=# Number of iterations to make. This works with -i
(--sleep) only.
...... bla bla bla.....
Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
count 0
force FALSE
compress FALSE
character-sets-dir (No default value)
default-character-set (No default value)
host (No default value)
port 0
.........bla bla....
ping Check if mysqld is alive
processlist Show list of active threads in server
reload Reload grant tables
refresh Flush all tables and close and open logfiles
shutdown Take server down
status Gives a short status message from the server
start-slave Start slave
stop-slave Stop slave
variables Prints variables available
version Get version info from server
roshaili-osmans-ibook-g4:~ roshailiosman$ >
-----------------finish-----------------
Does that mean that I'm connected to mySQL?
Does anybody how to connect to MYSQL from the terminal? Thanks.
iMac Mac OS X (10.4.6)
iMac   Mac OS X (10.4.6)  

Your biggest 'issue' right now is that your mysqld process is stopping on you -- making a connection impossible.
Why it's bombing might be in a log .. try in mysql/data/usr.local.err .. and fix why itsbombing.
To connect to it it'll be : mysql -u root -ppassword -D database

Similar Messages

  • Database error #2002 can not connect local mysql server to socket through '/var/run/mysqld/mysqld.sock'(2) on mac os x 10.9.2

    Dear Fellas:
    I received "database error #2002 can not connect local mysql server to socket through '/var/run/mysqld/mysqld.sock'(2)" on mac os x 10.9.2.
    mysql info:
    ps -ef | grep mysql
        0    66     1   0 11:06AM ??         0:00.04 /bin/sh /usr/local/mysql/bin/mysqld_safe --user=mysql
       74   225    66   0 11:06AM ??         0:02.50 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/Chuans-MacBook-Pro-2.local.err --pid-file=/usr/local/mysql/data/Chuans-MacBook-Pro-2.local.pid --socket=/var/run/mysqld/mysqld.sock
      501   952   947   0  3:52PM ttys000    0:00.00 grep mysql
    Please help!!

    Fascinated and guessing:
    Something related to sock(2) because that's not part of your copied info. I'm thinking you've doubled up on sockets and the second socket doesn't exist, meaning you should be connecting to the first socket "mysqld.sock" whether automatic or not.
    I've only used GUI tools on purpose, so does this mean you've already got MySQL running and you tried to launch it again manually? Perhaps you already have one instance of a db and you're trying to launch a second instance, and the two can't coexist with a single user local db?
    Assuming this is all local, I'd shut down the db service and restart it, out of hand. I've seen similar messages when I set the db to start up on boot, and it didn't finish shutting down when I tried to restart it manually. Usually the GUI won't let me turn it on because it reports it's already running, but in that case it hadn't finished performing what the GUI was reporting.
    Just speculating.

  • Can't connect to local MySQL server through socket '/var/mysql/mysql.sock'

    I'm using the pre-installed versions of php and mysql under Mac OS X Server 10.4.4 running on a G4 and am unable to get anything involving mysql to work.
    I ssh to the server and enter various commands in Terminal:
    on typing "mysql" I get
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)
    and on typing "mysqladmin version" I get
    mysqladmin: connect to server at 'localhost' failed
    error: 'Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)'
    Check that mysqld is running and that the socket: '/var/mysql/mysql.sock' exists!
    On typing "sudo mysqld_safe" I get
    Starting mysqld daemon with databases from /var/mysql
    STOPPING server from pid file /var/mysql/MyServer.local.pid
    070722 16:06:05 mysqld ended
    /var/mysql/MyServer.local.err contains
    070722 16:06:04 mysqld started
    070722 16:06:04 [Warning] Setting lowercase_tablenames=2 because file system for /var/mysql/ is case insensitive
    070722 16:06:04 InnoDB: Database was not shut down normally!
    InnoDB: Starting crash recovery.
    InnoDB: Reading tablespace information from the .ibd files...
    InnoDB: Restoring possible half-written data pages from the doublewrite
    InnoDB: buffer...
    070722 16:06:05 InnoDB: Starting log scan based on checkpoint at
    InnoDB: log sequence number 0 43634.
    /var/mysql has permissions 775.
    The line
    mysql.default_socket = /var/mysql/mysql.sock
    is in /etc/php.ini
    whereis mysqladmin ->
    /usr/bin/mysqladmin
    whereis mysql ->
    /usr/bin/mysql
    ls /var/mysql ->
    MyServer.local.err
    ib_logfile1
    mysql
    ib_logfile0
    ibdata1
    test
    Can't find my.cnf or my.ini anywhere
    Can't find mysql.sock anywhere
    I'm trying to get a bug database running (mantis) under Mac OS X Server 10.4.4 that I can access from local clients.
    I'm trying to follow directions at http://www.mantisbugtracker.com/manual/manual.installation.php
    without knowing anything about mysql or php and I'm stuck on step 3:
    "Next we will create the necessary database tables and a basic configuration
    file."
    I get a message saying
    "Does administrative user have access to the database? ( Lost connection to MySQL server during query )"
    I don't even know if following the mantis directions has resulted in the creation of a database or not. Where would it be?
    Thanks for any help.
    Intel iMac   Mac OS X (10.4.10)  

    I've just done a clean install of OSX Server and added the latest MYSQL packaged installer. Afterwards I found the lock file in /private/tmp/mysql.lock
    The easiest way to solve this problem is to create a symbolic link so that the lock file appears to be in right place.
    e.g.
    cd /var
    sudo mkdir mysql <== this assumes the directory is missing
    cd mysql
    sudo ln -s /private/tmp/mysql.sock mysql.sock
    After this msql commands should work fine, and you've not fiddled with the security settings on users/groups.
    HTH
    Christian

  • ./mysqlshow: Can't connect to local MySQL server through socket '/tmp/mysql

    hi all ,I install mysql on Solaris 10 at first it work fine , but after I restart my PC and go back again I got error on
    ./mysqlshow: Can't connect to local MySQL server through socket '/tmp/mysql
    I google , but still not sure how to deal with it
    Thank you

    I've just done a clean install of OSX Server and added the latest MYSQL packaged installer. Afterwards I found the lock file in /private/tmp/mysql.lock
    The easiest way to solve this problem is to create a symbolic link so that the lock file appears to be in right place.
    e.g.
    cd /var
    sudo mkdir mysql <== this assumes the directory is missing
    cd mysql
    sudo ln -s /private/tmp/mysql.sock mysql.sock
    After this msql commands should work fine, and you've not fiddled with the security settings on users/groups.
    HTH
    Christian

  • "Can't connect to local MySQL server through socket '/tmp/mysql.sock'"

    Data Services=3.1
    Repository=12.2.2.0000
    Red Hat Enterprise 5
    Designer,Job Server,Job Engine=12.2.2.3
    After an unscheduled server reboot with DS up and running when trying to start a job in either Data Services Management Console or DS Designer getting the following:
    "Can't connect to local MySQL server through socket '/tmp/mysql.sock'"
    The mysql.sock have never been in /tmp and on the production server it does not exist there and the production server is up and running correctly. If a link is created to mysql.sock(/home/user/boedge31/bobje/mysql) the job will start but return this message: 
    "Cannot retrieve <Version> from the repository. Additional database information: <SQL submitted to ODBC data source <localrepo> resulted in error <MySQL ODBC 3.51 Driver mysqld-5.0.46-enterprise No database selected>. The SQL submitted is <select VERSION, SECURITYKEY, GUID from AL_VERSION where NAME = 'Repository Version'"
    I checked and AL_VERSION and the Version field exist. 
    Before the shut down DS was working correctly and had no issues.  My best guess is a part of the repository was corrupted during the unscheduled shut down.  It seems like DS has "forgotten" some of the settings.  
    Any suggestions on a possible solution?

    The issue has been solved. 
    There was a bad path in $LD_LIBRARY_PATH.
    Removed the path and DS started working again.

  • ERROR#: 2002 can't connect to MySQL server through socket '/var/mysql/mysql.sock'

    I was following this adobe article (
    http://www.adobe.com/devnet/dreamweaver/articles/php_macintosh.html)
    to set up PHP and MySQL and connect a MySQL database to dreamweaver
    in Mac OS 10.4.8 and I kept getting:
    "Can't connect to MySQL server through socket
    '/var/mysql/mysql.sock' ERROR#: 2002".
    After a lot of searching I came across
    this
    article which said that there was an error in the PHP and MySQL
    connection or something.
    Anyway all I had to do was type (in a TERMINAL window):
    $ sudo mkdir /var/mysql
    $ sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
    and that fixed the problem, otherwise the adobe article
    worked very well.
    Check out the "this article" link to get the fix straight
    from the horse's mouth.

    I was following this adobe article (
    http://www.adobe.com/devnet/dreamweaver/articles/php_macintosh.html)
    to set up PHP and MySQL and connect a MySQL database to dreamweaver
    in Mac OS 10.4.8 and I kept getting:
    "Can't connect to MySQL server through socket
    '/var/mysql/mysql.sock' ERROR#: 2002".
    After a lot of searching I came across
    this
    article which said that there was an error in the PHP and MySQL
    connection or something.
    Anyway all I had to do was type (in a TERMINAL window):
    $ sudo mkdir /var/mysql
    $ sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
    and that fixed the problem, otherwise the adobe article
    worked very well.
    Check out the "this article" link to get the fix straight
    from the horse's mouth.

  • Can't connect to local MySQL server through socket '/tmp/mysql.sock' (46)

    I can't connect...I have th connection to the database form
    DW to the db....I can't get the server to connect. HELP!

    I've just done a clean install of OSX Server and added the latest MYSQL packaged installer. Afterwards I found the lock file in /private/tmp/mysql.lock
    The easiest way to solve this problem is to create a symbolic link so that the lock file appears to be in right place.
    e.g.
    cd /var
    sudo mkdir mysql <== this assumes the directory is missing
    cd mysql
    sudo ln -s /private/tmp/mysql.sock mysql.sock
    After this msql commands should work fine, and you've not fiddled with the security settings on users/groups.
    HTH
    Christian

  • Can't connect to local web server

    I'm not quite sure when this happened; I think it was upgrading to iPhoneOS 3.x but I can't swear to that (currently running 3.1). Anyway, the problem is that, whether from my app or even simply using Safari, I can't connect to a local webserver. If I'm on one computer in my office (working over WiFi just like my iPhone), and type "http://192.168.1.110/file", where 110 is a different computer, Safari will display the page just fine. But if I'm using my iPhone in the office, on the same network, and type the same URL, it will not connect. For SURE this used to work, and I haven't changed any settings on my network or on my iPhone for that matter.
    No problem with connecting to external websites, clearly.

    Web services are not relevant to DNS host names.  You'll need to configure a default domain name for whatever is being used as the local domain, whether that is established via System Preferences or via DHCP settings.  If your Windows box is running a DNS server, you'll need to set the Mac DNS resolver address at the Windows DNS server.

  • ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'

    PHP and Mysql aren't communicating on Mac OSX 10.4 and I
    tried changing the location for where PHP looks for the file, but I
    can't save in the etc folder. Help?

    D**iesel wrote:
    Apple made a presumption about MySQL and how it "should" be installed/configured.
    You mean correctly?
    Follow the instructions in this thread to properly configure PHP and MySQL on MacOS X: http://discussions.apple.com/thread.jspa?messageID=12229472&#12229472

  • MySQL Error 2002 when attempting to make a MySQL Connection

    I'm trying to make a MySQL Connection and I've got my Staging/Testing Server setup as FTP with the proper host, username and password for FTP, root directory set to '/' (without the quotation marks) and Web URL set to http://www.mysite.com/
    Tested the FTP and it connects.
    For mySQL connection in my bindings, I'm using:
    Connection Name; connRecords
    MySQL Server: localhost
    Username and then my Password for my DB which obviously I won't list here.
    I click Select Database and that's when I get the prompt:
    MySQL Error: #2002
    Can't connect to local MySQL Server through socket '/tmp/mysql.sock' (2)
    What does that mean and how do I get this to work?

    ladobeugm wrote:
    I click Select Database and that's when I get the prompt:
    MySQL Error: #2002
    Can't connect to local MySQL Server through socket '/tmp/mysql.sock' (2)
    What does that mean and how do I get this to work?
    On a Mac, connection to MySQL is done through a socket (mysql.sock). The fact that there's a (2) after mysql.sock indicates there's something wrong with the socket. Usually, you can clear the problem by powering down your computer and then restarting. Don't just do a restart. Make sure the computer switches off completely to clear the socket.

  • Can't connect to X11 Windows Server - Error

    Dear All,
    Greetings!!
    We had successfully installed ECC6.0 EHP7 with HANA Database on SUSE 11 SP3. Now we are in the process of upgrading the components in the ECC via SUM. When we try to start the upgrade via SUM using <SID>ADM userid in the Linux Machine, we are getting an JAVA Error like "Can't connect to X11 Windows Server". Please find the complete error log in the attached screenshot (SUM.pmg).
    But when we try the same with the root userid, we can able to see the SUM GUI Opening Screen.
    Please help us with suggestions or solutions at the earliest.
    Regards,
    Ela

    Hello Ella,
    Please follow the SUM upgrade guide for starting the SUM tool.
    Start the SL controller on primary application server with command :
    ./STARTUP
    After this, you can access the GUI from the browser :
    http://<host>:4239/
    Problem you described, seems to be related to variables.
    Please set the variable DISPLAY for the SIDADM user.
    Thanks.
    Regards,
    Gaurav

  • Error -2147467259, can't add item to OPC Server

    I am using a DataSocket connection to read/write through an OPC Server (GE SRTP) to PLC software (PME).  Everything works fine on my 2 different development PC's in my office, both in .vi form, and executable.  I have distributed my executable on our network, and 2 of the 4 PC's we use to test product work fine.  The other 2 PC's have the same problem, error -2147467259, can't add item to OPC server.  When the OPC Server is called by LabVIEW, it launches successfully, but immediatly shows the 'can't add item to OPC Server'.  I believe that it has to do with the registry.  I registered the opcproxy.dll, and it still fails.  LabVIEW 7.1, Windows XP machines.
    Thanks, Alan

    Duplicate post, please refer to:
    http://forums.ni.com/ni/board/message?board.id=140&message.id=23173&requireLogin=False
    For original thread.
    I would like to echo Sam's inquiry about launching the OPC server outside of LabVIEW and verifying that it can be connected to.  Also, under what user name is the OPC server being launched?  Sometimes you can run into trouble if the user name is not the current user logged onto the system, but I haven't heard of it causing this error.  You can see what user launched the service under Control Panel >> Administrative Tools >> Services.  You can verify the default user running the application by going to Control Panel >> Administrative Tools >> Component Services and navigating to Component Services >> Computers >> My Computer >> DCOM Config  Right click on your DCOM server and select Properties.  Then go to the Identity tab and make sure The Interactive User is selected. 
    Brian Coalson
    Software Engineer
    National Instruments

  • I am using only one Apple ID. The problem, since iOS 6,  is the App Store purchased items screen just shows loading screen  it finally crashes or gives the error message 'can not connect to  Apple store'

    I am using only one Apple ID. The problem, since iOS 6,  is the App Store purchased items screen just shows loading screen  it finally crashes or gives the error message 'can not connect to  Apple store'

    I am using only one Apple ID. The problem, since iOS 6,  is the App Store purchased items screen just shows loading screen  it finally crashes or gives the error message 'can not connect to  Apple store'

  • "oemcrtl start oms" doesn't work, the error is "can't connect to OMS"

    I created the repository by emca successfully, "lsnrctl start" is no problem, but when I run "oemctrl start oms", I got error message "can't connect to OMS", I should check which configure files?

    Hi,
    May be this is unnecessary to say. Behalve your listener also the database where your management server repository resides has to be open. Then start the management server with the following command:
    "oemctrl start oms sysman/oem_temp@<name of your machine>" (so replace name of your machine). Should be working if you can open your database.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Kevin LI ([email protected]):
    I created the repository by emca successfully, "lsnrctl start" is no problem, but when I run "oemctrl start oms", I got error message "can't connect to OMS", I should check which configure files?<HR></BLOCKQUOTE>
    null

  • Mysql socket error 2002

    I've read all about this error and have played around with it for a while and still can't get it to work. This is how I got to where I am.
    1. installed OS X Server fresh and updated to 10.4.7
    2. installed entrophy php 5.1.4 from the installer pkg
    3. installed mysql standard 5.0.22 from the installer pkg
    4. installed phpMyAdmin and am trying to browse to http://localhost/phpMyAdmin/index.php and am getting the socket error 2002
    I read the technote http://docs.info.apple.com/article.html?artnum=302977 which refers to the mysql.sock file.
    when I start up mysql, it says 'running' and the mysql.sock file is in /var/mysql/ my php.ini file is pointing there. the /etc/my.conf file is pointing there.
    yet I'm still getting this error.
    What am I missing?

    At this point, you have two versions of PHP and two versions of MySQL installed on your system. So, when you say you start up MySQL, how are you doing that?
    For a MySQL-package installed version, you need to start up MySQL in the path /usr/local/mysql/bin/... or use the StartupItem they provide, which would be "/Library/StartupItems/MySQLCOM/MySQLCOM start". Then check where the mysql.sock file is with "/usr/local/mysql/bin/mysqladmin -u root variables" (or "/usr/local/mysql/bin/mysqladmin -u root -p variables", if you've given your root user a password so far).
    Also, you can check your PHP installation's default MySQL socket file search path with "/usr/local/php5/bin/php -i" and see what the "MYSQL_SOCKET" variable states is the location for the MySQL socket file.
    You just have to make sure these two things are in sync in order to get something like phpMyAdmin to run.
    NOTE: If you just type "php" or "mysql" at the command line, you're going to be launching/using Apple's preinstalled versions, so you'll always need to use the full path when working on the command line.

Maybe you are looking for

  • IViews opening up in "closed" mode.

    Hello All, As a business requirement some IViews in our portal requires to be opened in a "closed" or "minimized" state. This was easily done, because we can configure this in the IView properties. But I noticed that once we maximime (or open) one su

  • REST API ACS vs ISE

    Hi all We are currently using ACS for wireless authentication. Guests register over an external Sharepoint webpage. The REST API is used to create and later delete these temporary users in ACS. Now we want to migrate to ISE. In contrast to ACS, the I

  • How can I tell what has already been edited in Ps CC?

    When using PS5 the photos that have yet to be edited have a white border, and the ones that have been edited, have a black border.  In PS CC, they are all white.  Is there a setting I can change to correct this?

  • Using same dimension again and again

    Hi All, I have one problem in which one fact has many wid's and these all fact wid's connect with the single dimension. As per me I can create alias of the dimension and join them with fact to achieve it. scenario Fact1 x1-wid joins with xx1 wid of d

  • Debug issue with maven eclipse

    Hi, I am trying to debug my web application with eclipse.I am using maven as a build tool. I found this error: set INT_MAVEN_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=y -Xdebug -Xnoagent -