Home
 

Customer Support

Search for keywords:

Browse by category:

I can't connect to local MySQL server through socket 'mysql.sock'

You are trying to connect to "localhost" which is a web or shell server, not a database server.

Please see this other FAQ for your correct database hostname.

If you need detailed database connection instructions, please see this other FAQ.

User-Contributed Notes

add a note
17-Oct-2004 00:07
From the manual
(http://dev.mysql.com/doc/mysql/en/Can_not_connect_to_server.html):
"A MySQL client on Unix can connect to the mysqld server in two
different
ways: By using a Unix socket file to connect through a file in the
filesystem (default `/tmp/mysql.sock'), or by using TCP/IP, which
connects
through a port number. A Unix socket file connection is faster than
TCP/IP,
but can be used only when connecting to a server on the same computer."

Therefore, do not make up a DSN like:

  mysql://USER:PASS@unix+HOST/DBNAME

it has to be

  mysql://USER:PASS@HOST/DBNAME

add a note

Related Questions:


How do I import delimited data into MySQL?

How do I change my MySQL password?

How do I import a MySQL dumpfile into my database?

How can I export data in CSV or tab delimited format?

How do I connect to my MySQL database?

Why do i get a query syntax error 1064 from MySQL when the syntax seems correct?

How do I export and move my database tables between servers or copy databases?

How do I create a .my.cnf MySQL preference file?

What is my database server name?

How do I change MySQL timezone?

What is my MySQL Username or Database Name?

MySQL says I have too many connections.

How do I check how much disk space my database is using?

A MySQL MYI table has errors in it.

Can I connect to MySQL remotely?

Can I connect to my MySQL database from my own computer?

I can't get phpMyAdmin to work.

phpMyAdmin gives SQL syntax error when I try to create table.

How can I use odbc_connect() in my PHP scripts to connect to MySQL?

What kind of database server do you offer?

How many databases do I get?

What am I allowed to do with my MySQL database?

Will we be able to do our own MySQL admin?

How do I import a MySQL dumpfile into my database via phpMyAdmin?

Do you offer MySQL 5?

How do I export a MySQL dumpfile via phpMyAdmin?

Browse Categories:

Getting Started, FTP, Telnet/SSH, Moving Domains, E-mail, Traffic Reports, Mailing Lists, Apache, PHP, CGI, Other Server-Side Scripting, MySQL Database, Imaging Libraries, Other Software, Billing & Terms, Control Panel, E-commerce, Pre-Sales


Tiny Modwest Logo         Copyright 2000-2008 by Modwest, Inc.          About Us    |    Blog    |    Jobs    |    Web Design    |    Contact Us