简体   繁体   中英

Can't connect to database

Actually I'm having more than one problem...but all of it has to do with connecting or working with the MySQL database...First you can see one of the errors on my website and no matter what you choose it seems to just say it can't connect to the database...I've configured a configure.php file to allow files to connect to the MySQL database...see the website here:

http://netsurfer123.byethost11.com/index.php

Then when I try to log-in to the Admin area of my MySQL database it just says:

phpMyAdmin - Error Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.

Please let me know what I can do to correct these errors...and thanks very much in advanced for any helpful response/s.

First you need to check if the MySQL server is actually running. Use a command such as

/etc/rc.d/init.d/mysqld status

Or similar for your system if possible.

Did you check the web server log file? Does it contain errors as indicated by phpMyAdmin?

Your site is simply unable to connect to the database to which it's trying to connect. This could be for any number of potential reasons:

  • Is the database running?
  • Is the database accessible by that machine? (Maybe there's a firewall in between the two servers, if they're separated?)
  • If the database is on that same machine, are you connecting to it properly? (Maybe it allows only certain connection methods, such as a socket vs. the loopback address?)
  • Is your connection string correct? Maybe the login is failing?

Check your PHP logs, your Apache logs, your MySQL logs. One of them is complaining about something and it's probably trying to tell you what.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM