I own a wordpress website (website.com) that running well with hosting service (cpanel). So i want to create a new subdomain (new.website.com) and install wordpress in there but for the database i want to use Compute Engine from Google Cloud Platform.

I already install mysql on the CE and running perfectly, but unfortunately i couldn't connect it to my hosting service to install wordpress.

how can i do this?

what i already tried:

  1. create mysql on CE (running with ssh)
  2. create database, create user(connect to web ip), and password
  3. changing the my.cnf (change the bind-address to
  4. setting up wp-config installation on file manager on my hosting service, such as: database_name,user,password, and host
  5. connect the database from CE to mysql client (mysql workbench)
  6. make sure the port open: 3306

output: "error establishing a database connection" when i try new.website.com

potentially to be the problem:

  1. the mysql, i couldn't retrieve the database ip, cs when i run "mysql> status" it would return: connection: Localhost via UNIX socket
  2. the wp-config setup, do i need to change the db_host? i thought it should be the database ip, but i couldn't get the ip.

cheers from indonesia.

  • 3
    Hi Rio! This is more of a problem to do with setting up a MySQL server than it is to do with Wordpress specifically. You may have more luck posting on e.g. ServerFault where you might get more specialised answers for MySQL. – mozboz Jul 27 at 11:50
  • 2
    I searched for 'GCP make mysql public' and found this. Did you do all the steps here? cloud.google.com/sql/docs/mysql/connect-admin-ip – mozboz Jul 27 at 11:51
  • @mozboz thanks for the recommendation, i'll bring this issue there, thanks. I did check that page, but thats for Cloud SQL, meanwhile mine is mysql that runs in CE – Rio Manik Jul 28 at 4:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.