简体   繁体   中英

Connecting a Lightsail instance of WordPress to a Lightsail MySQL Database

This is my first go at AWS. I'm trying to install a WordPress site. Here's what I've done so far:

Created a LAMP instance in Lightsail. I'm able to:

  • SSH into the webroot with Terminal
  • SFTP into the webroot with Filezilla
  • Successfully uploaded and expanded the latest version of WP in the webroot
  • Using the public IP, accessed the WP setup screen

Created an instance of a MySQL database in Lightsail. I'm able to:

  • Use Terminal to tunnel into and access it in the browser with PHPMyAdmin
  • Successfully create an empty database and user with full access permissions

Additionally:

  • Both instances are running in the same region: Virginia, Zone A (us-east-1a)
  • I have enabled both Data migration and Public Mode

At the WordPress setup screen I enter the database name, user, password and host. I believe the database host is what the instance calls the endpoint? After all that, I get the following error:

We were able to connect to the database server (which means your username
and password is okay) but not able to select the publicUser database.

I'm quite sure the required credentials are correct, so it must be something with how I'm doing the setup? Any ideas? If anyone has this same setup, can you please post your WordPress config file with the sensitive information removed so I can see how you're connecting?

You've done everything correctly so far. WordPress is now looking for a database with the name publicUser which it cannot find. You either did not create that database (via PHPMyAdmin) yet, or are using the wrong database name.

Once you have either created the database or corrected the configured database name, it should work.

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