• Hello,

    We try to install WordPress to Linux server with LAMP but we face problems with connecting mySQL to WP. It says “cannot connect to database”. We have tried to fix this but it seems that we cannot get forward. Could anyone be able to help??

    Many thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    1. Is the server running? ps -ef |grep mysqlor ps -ef |grep mariadb Do you see it running?

    2. If running, can you login with the values in wp-config.php?

    mysql -u DB_NAME -pDB_PASSWORD -h DB_HOST DB_NAME

    Note there is no space after -p.

    3. Have you installed the mysql libraries for PHP?

    Hi @sakulainen,

    Do you changed your database hostname, password,user in wp-config.php? Database is in localhost or use a remote mysql database? If you use remote mysql database you need setting mysql to allow remote connect, also do you checked your firewall settings?

    Hope this have a little help. ??

    Best Regards,
    Tomas

    I think so, have you ever edited wp-config.php file.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Linux, problems with connecting WP to MySQL’ is closed to new replies.