Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Hi,
I installed mandrake 9.1 and want to setup a webserver. Mysql starts as a service, but whenever I am trying to connect I get an error message 'Call to undefined function: mysql_connect() ' making me think that mysql is not running at all.
How are you connecting to MySQL? Use 'mysql -u root -p' if you've defined a root password for MySQL already, or just plain 'mysql' if you haven't. If MySQL isn't running and you try to connect, you'll get a:
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
I've never seen that error message that you provide in my life.
Your problem is most likely that you didn't install the php-mysql-4.3.0-2mdk package, which gives PHP the functions it needs to interact with a mySQL database. I tried to check your phpinfo and your IP address has apparently changed, but I assume this will fix your problem.
Help,, now I am getting an error ' Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on '127.0.0.1' (111) in /var/www/html/officebox/Connections/myconnections.php on line 12
Can't connect to MySQL server on '127.0.0.1' (111)' .
I am trying to access mysql as username root (both mandrake as mysql)
I installed mysqlcc, a GUI for mysql, but even there I get the same message
maybe mysql server is running on another host than 127.0.0.1 or is using a different port than 111? are u sure the server is running at all? type
ps -e | grep mysql
to check it
cheers, jens
That command lists all the current processes.. If mysql is NOT in the list, then it is likely NOT running at the moment. Try typing mysql at the prompt to see if you are taken into the mysql command line client.. If it's not in the list from ps -e, then you should get an error like:
"ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)"
That means that mysql is not running. I've found that occasionally Mandrake refuses to start up mysql properly. So I have added the following commands to /etc/rc.d/rc.local :
sleep 5
/etc/init.d/mysql start
Those commands tell mandrake to wait 5 seconds, then launch mysql. If mysql is already running, no harm done. If it's not, then this starts it. For the moment, try typing "/etc/init.d/mysql start" at the prompt then try your script -- see if it will work now.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.