I installed phpMyAdmin in my server when i tried to open it in the browser i'm getting the following error. i have modified the config file for the host, user, password. Any help would be appreciated.

Welcome to phpMyAdmin 2.5.5-pl1

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in config.inc.php and make sure that they correspond to the information given by the administrator of the MySQL server.

Warning: Cannot add header information - headers already sent by (output started at /var/www/html/phpMyAdmin-2.5.5-pl1/libraries/auth/config.auth.lib.php:96) in /var/www/html/phpMyAdmin-2.5.5-pl1/libraries/header_http.inc.php on line 14

Warning: Cannot add header information - headers already sent by (output started at /var/www/html/phpMyAdmin-2.5.5-pl1/libraries/auth/config.auth.lib.php:96) in /var/www/html/phpMyAdmin-2.5.5-pl1/libraries/header_http.inc.php on line 15

Warning: Cannot add header information - headers already sent by (output started at /var/www/html/phpMyAdmin-2.5.5-pl1/libraries/auth/config.auth.lib.php:96) in /var/www/html/phpMyAdmin-2.5.5-pl1/libraries/header_http.inc.php on line 16

Warning: Cannot add header information - headers already sent by (output started at /var/www/html/phpMyAdmin-2.5.5-pl1/libraries/auth/config.auth.lib.php:96) in /var/www/html/phpMyAdmin-2.5.5-pl1/libraries/header_http.inc.php on line 17

Warning: Cannot add header information - headers already sent by (output started at /var/www/html/phpMyAdmin-2.5.5-pl1/libraries/auth/config.auth.lib.php:96) in /var/www/html/phpMyAdmin-2.5.5-pl1/libraries/header_http.inc.php on line 20

Server localhost
Error

MySQL said:

#2002 - Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

[Documentation]

    Does your MySQL put its sock in /var/lib/mysql/mysql.sock or in /tmp/mysql.sock. /tmp is usualy the default for the sock file.

    Make sure your config file can find the sock.

      Thanks Spider i got it done and its working fine now. I have another problem though. Mysql and Apache are not starting automatically when the system boots up i need to go and do it everytime i boot up the system. Is there way to solve this?

      Another question: I managed to put a .htaccess for a folder in the server. I did the necessary thing in the httpd.conf file and it works out very well. It asks for the username and password but unfortunately the username and password i created is not working out. Any suggestions or any sort of guide i can use to create it properly again?

      Many Thanks

        I assume you are running windows (On a linux machine you would probably have done some scripting youerself, on a mac I do not know !)

        I have this batchfile:

        cd C:\phpdev\apache
        start apache -k start
        cd  C:\phpdev\
        start apachemonitor.exe
        NET START mysql
        start [url]http://localhost/[/url]
        exit
        

        which I call when I want the server to start under win2000, and this:

        NET STOP mysql
        cd C:\phpdev\apache
        apache.exe -k shutdown
        exit
        

        to stop the server. You could add the first set to your startup folder in windows? you need to have MySQL instaled as a service in window though.

        J.

          Ok. if your using a basic auth scheme then you need to use htpasswd to make the file. htpasswd <filename> user.
          Then it will ask you to put in a password for that user. Then you point Apache to use that file as the auth file.

            oops.. sorry i forgot to mention that i'm running it on Linux 9.0. Do you have any solution for starting up the httpd and the mysql automatically when the linux server boots up?

            Regarding the .htaccess i did create a file which contains all the user and password by using .htpasswd it created perfectly, but when i tried to use the username and password to login in the folder its not allowing me in. Do you have any sort of step by step guide?

            Thanks for ur help๐Ÿ™‚

              Ok, you've already made the file. That's good.

              Here's the configuration I have that stops people from coming in to mine.

              If you have access to the configuration file httpd.conf. Then to protect a directory, such as the document root. You put in (if the directory was like /www/sitename/html):

              <Directory /www/sitename/html>
              AuthType Basic
              AuthName "Password Required"
              AuthUserFile /path/to password/file
              Require valid-user
              </Directory>

              if you're using the .htaccess file then put the above in without the <Directory> and drop the file in the document root directory. It should work.

              Your password file made by htpasswd should look like:

              username:<something that looks like garbage>

              In order to start apache automaticaly for RedHat 9.0 you need to put in a startup script in /etc/init.d (also /etc/rc.d/init.d). RedHat usualy already has one for httpd so check for it by running chkconfig httpd on if it doesn't complain, you're golden. MySQL is the same but if you compiled it yourself you'll have to copy the script in and add it yourself.

              Hope this helped.

                thanks once again spider

                Yes i have the httpd and the mysqld startup script in the rc.d/init.d folder and i do mysqld start and httpd start everytime i boots up the system, but is there way it starts up these two services automatically rather than typing these two lines everytime?

                  Ok, if you have the control scripts in already then you need to turn them on by issuing the command:

                  chkconfig httpd on - for Apache
                  chkconfig mysqld on - MySQL

                  if chkconfig complains that the mysqld service doesn't exist then you need to:

                  chkconfig --list

                  To see if the mysqld control file is registered with chkconfig. If its not, then add it in:

                  chkconfig --add mysqld

                  Then turn it on using the chkconfig mysqld on command. When you reboot the machine both should start up automaticaly.

                    Write a Reply...