I’ve been trying to setup a wordpress site through c9.io but have been experiencing some issues. I’ve followed the instructions to the letter(as posted on their website) and I still seem to be having some problems getting it set up. I did the following steps:
- Create the wordpress instance through the c9.io dashboard
- start and create the mysql database using the following command: “mysql-ctl start”
- Go to the index.php file and run it.
- Once the index.php file runs, follow the link to setup the wordpress site.
After doing all of those 4 steps and I click the link that is produced from running the index.php file, I get the following message from the browser: “Error establishing a database connection”. I don’t know what I’m doing wrong since I’ve been following the instructions as closely as I possibly could. The instructions can be found from this link btw: https://docs.c9.io/v1.0/docs/running-wordpress-on-cloud9
If anyone can tell me what I’m doing wrong and how to fix it I would greatly appreciate it. It seems like everything is working properly until I click on the link produced by index.php. Once I click on that link I receive the error message. Please let me know how you guys were able to remedy this issue. Thanks.
Due to the fact that your cloud9 username is longer than 16 characters and MySQL usernames cannot be more than 16 characters long, you would have to update your wp-config.php to pass only the first 16 characters. Currently it should say something like:
you can replace
getenv('C9_USER')
with the first 16 characters of your username. This should make it work.Incase the above answer does not fix this issue for other intrepid searchers.
I found
mysql-ctl status
would allways show the service as stoppedmysql-ctl start
had no effect andmysql-ctl cli
returned the OP error.Using
mysql-ctl install
I reinstalled (wiped) the original installation and got a fresh one which worked right off the bat.Hope it helps someone.