In the name of Allah Hello I wrote a code to connect to MySQL in Fedora 9 using mysql_real_connect function but I recieved the error by mysql_error (Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)). I checked "mysql_config --socket", it returned /var/lib/mysql/mysql.sock I checked 'SHOW VARIABLES LIKE '%SOCKET%'', it returned /var/lib/mysql/mysql.osck I modified my.cnf file But I still recieved this error Please, help me how to solve this error Thanks in advance Hamed