0

I have an Elastic Beanstalk instance that I have SSH access to. I have downloaded and extracted Wordpress to the correct directory. I can serve files from this directory and domain.

I have configured the wp-config.php file:

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'root');

/** MySQL database password */
define('DB_PASSWORD', '!~?5tr0ngP@ssw0rd!~?');

/** MySQL hostname */
define('DB_HOST', 'wordpressblog.abcdefgh.eu-west-1.rds.amazonaws.com:3306');

I've generated auth keys/salts from here, too: https://api.wordpress.org/secret-key/1.1/salt/

After connecting to my domain, (blog./wp-admin/install.php), I complete the form to create a user, password, blog title. Proceeding onto step 2, error: WordPress database error: [The MySQL server is running with the --read-only option so it cannot execute this statement]

As far as AWS security groups are concerned, I can SSH into the EB/EC2 instance and mysql -h into the RDS instance.

  • Doing an INSERT using the MySQL command-line:

  • SSH'd into the EB instance (anonymised some of this)

  • mysql -h wordpressblog.abcdefgh.eu-west-1.rds.amazonaws.com -u root -p

  • Asks for password, I enter, it accepts.

  • show databases shows my 'wordpress' database I had previously created with MySQL Workbench:

    mysql> show databases;

    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | mysql              |
    | performance_schema |
    | wordpress          |
    +--------------------+
     * mysql> use wordpress;
     * create table test
    

Output:

mysql> create table test;
ERROR 1290 (HY000): The MySQL server is running with the --read-only option so it cannot execute this statement

Here is the output of:

mysql -h wordpressblog.abcdefgh.eu-west-1.rds.amazonaws.com -u root -p -e 'SHOW GRANTS; SELECT @@READ_ONLY;'

+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for root@%                                                                                                                                                                                                                                                                                                                                                                                               |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, LOAD FROM S3 ON *.* TO 'root'@'%' IDENTIFIED BY PASSWORD '*4799CE6D6F3B146932C3716AD5B832561976A479' WITH GRANT OPTION |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+-------------+
| @@READ_ONLY |
+-------------+
|           0 |
+-------------+

How can I bypass this read-only problem?

  • I've never heard of a "read only" mode for any database in RDS. Try to do an insert using the mysql command line, and please edit your question to include that session. You mention a my.cnf on your server, that would only exist if you have MySQL installed locally. Please edit your question to include the top part of your wp-config.php file (the part it says you can edit). – Tim Mar 30 '17 at 18:03
  • I have made the edits you have suggested, thank you, @Tim. – djdavies7 Mar 31 '17 at 9:48
  • Read-only mode is used by replica servers, and is an option you can set in the RDS Parameter Group (but don't. If it's there, it should be there for a reason.) Show us this: mysql -h wordpressblog.abcdefgh.eu-west-1.rds.amazonaws.com -u root -p -e 'SHOW GRANTS; SELECT @@READ_ONLY;' – Michael - sqlbot Mar 31 '17 at 9:58
  • Prefix each line of the block with 4 spaces or click the "format as code" button with the block highlighted, when editing the results into the question, to make it legible. – Michael - sqlbot Mar 31 '17 at 10:00
  • Added the requested outputs and formats in my edit. Thanks @sqlbot. – djdavies7 Mar 31 '17 at 10:10

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.