Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
1.4k views
in Q2A Core by
Hi,

I've been trying to install Q2A for two days now with no success. I keep getting the error:

PHP Question2Answer MySQL query error 1146: Table 'demo.qa_options' doesn't exist - Query: SELECT title, content FROM qa_options

uppon loading the site for the first time. I never get to the installation screen. I've read all the posts about a bug for new installations. But I've tried all the versions from 1.6.3 upto 1.8 and I always get the same error. I have deleted the database and recreated it evrytime but I just can't get pass this error.

Is there a way to create this table manually?
Q2A version: 1.7.5
by
Do you have the correct MySQL username/password and user permissions?
Are all the other tables created correctly? You can use phpMyAdmin to look at the database.
by
Yes, to make sure I put a wrong password in and the error returned was different. No table is created at all. Nothing is shown when I go to the site and this error is returned.

1 Answer

+3 votes
by

Based on your symptoms you might be lacking the appropriate MySQL user privileges. Take a look at the installation steps again:

4. Create a MySQL database, and a MySQL user with full permissions for that database. If you’re interested, the privileges actually needed are: CREATE, ALTER, DELETE, INSERT, SELECT, UPDATE, LOCK TABLES

Make sure the user has all those privileges.

Relavant links:

by
Thanks for the answer but I even tried with root user. I still get the same error
by
1. What is the output of running this command in PHPMyAdmin?

CREATE TABLE `demo_options` (
  `title` varchar(40) NOT NULL,
  `content` varchar(8000) NOT NULL,
  PRIMARY KEY (`title`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

2. Does it create the table?
by
Yes, it creates the table
by
Well, that's exactly the query Q2A runs. So you will have to make sure your qa-config.php file matches your MySQL sever requirements and configuration.
by
Here is the configuration in qa-config.php:

define('QA_MYSQL_HOSTNAME', '127.0.0.1');
define('QA_MYSQL_USERNAME', 'root');
define('QA_MYSQL_PASSWORD', '*******');
define('QA_MYSQL_DATABASE', 'demo');

Is there anything else that needs to be set?

I haven't installed Q2A before, so I'm not sure, shouldn't it show a setup page before trying to create the tables?

In my setup connecting to Q2A shows the error straight away.
by
It looks fine. As long as that information is properly set and you have the needed privileges on the root user, it should be fine. If the IP address is fine you could also check with 'localhost' instead of '127.0.0.1'. I've seen a couple of issues regarding that.

Once you have configured those settings all you need to do is to navigate to the root of your site and then you'll be redirected to the installation wizard. Use Q2A v1.7.5. Make sure you're hitting the appropriate URL :)

This is a long shot but you could also make sure you have mod_rewrite enabled in Apache. Or even access the install wizard directly: http://yoursite.com/index.php?qa=install

Maybe a longer shot would be that, assuming you're seeing that in the Apache's server error log file rather than in the browser, maybe you've somehow configured PHP to halt on errors so the first attempt to access the database, rather than throw the error and redirect to the wizard is just throwing the error.
by
Thank you. The information you provided was a great help. Here is what I did:

I created the qa_options table manually using the query you provided.
Then I navigated to http://yoursite.com/index.php?qa=install (going to the root whould provide the same error) This time it prompted that the database is faulty and some tables are missing and it gave me a button to repair the database.
By clicking the button It created all the tables and it is working fine now.

Thank you again for your help
...