MySQL, PHP, and Apache errors while connecting to DB

Posted by cypherdelton on Stack Overflow See other posts from Stack Overflow or by cypherdelton
Published on 2011-11-28T01:45:37Z Indexed on 2011/11/28 1:50 UTC
Read the original article Hit count: 146

Filed under:
|
|
|
|

I'm having two errors when I test the "mysql_connect()" function in php. I just installed PHP and MySQL from scratch. These errors may be related, so I will post them both here:

Warning: mysql_connect() [function.mysql-connect]: Headers and client library minor version mismatch. Headers:50158 Library:50518 in /usr/local/apache2/htdocs/index.php on line 6

Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /usr/local/apache2/htdocs/index.php on line 6

Many websites say to start the mysql server if you are getting error #2. Whenever I execute the command

mysqld start --user=mysql

I get the error "mysqld: Too many arguments (first extra is 'start');

Adding the "&" to the end of the command makes no difference (I don't know if it is supposed to).

Thanks,

Cypher Delton

© Stack Overflow or respective owner

Related posts about sockets

Related posts about webserver