Username
Forgot password?
Welcome to our site!
Or Join with FTTF

get an error when asking question

0

1533 views
ERROR September 3, 2012 11:18:36 Lampcms\WebPage-> handleException()
/var/www/lib/Lampcms/WebPage. php line: 962
Exception caught in: /var/www/lib/Lampcms/DB.php on line: 152 Cannot connect to database: SQLSTATE[42000] [1049] Unknown database 'LAMPCMS' trace: #0 /var/www/lib/Lampcms/DB.php( 164): Lampcms\DB->connect()
#1 /var/www/lib/Lampcms/DB.php( 534): Lampcms\DB->getDbh()
#2 /var/www/lib/Lampcms/Modules/ Search/MySQL.php(370): Lampcms\DB->makePrepared(' SELECT?????qid,...')
#3 /var/www/lib/Lampcms/Modules/ Observers/Similars.php(78): Lampcms\Modules\Search\MySQL-> getSimilarQuestions(Object( Lampcms\Question))
#4 /var/www/lib/Lampcms/Event/ Observer.php(119): Lampcms\Modules\Observers\ Similars->main()
#5 [internal function]: Lampcms\Event\Observer-> update(Object(Lampcms\Event\ Notification))
#6 /var/www/lib/Lampcms/Event/ Dispatcher.php(326): call_user_func_array(Array, Array)
#7 /var/www/lib/Lampcms/Event/ Dispatcher.php(349): Lampcms\Event\Dispatcher->_ notify(Object(Lampcms\Event\ Notification), true, false, 'Lampcms\Questio...', 'EVENT_DISPATCHE...')
#8 /var/www/lib/Lampcms/Event/ Dispatcher.php(523): Lampcms\Event\Dispatcher->_ notify(Object(Lampcms\Event\ Notification), true, true, 'Lampcms\Questio...', 'onNewQuestion')
#9 /var/www/lib/Lampcms/ QuestionParser.php(301): Lampcms\Event\Dispatcher-> post(Object(Lampcms\Question), 'onNewQuestion')
#10 /var/www/lib/Lampcms/ QuestionParser.php(137): Lampcms\QuestionParser-> makeQuestion()
#11 /var/www/lib/Lampcms/ Controllers/Ask.php(107): Lampcms\QuestionParser->parse( Object(Lampcms\ SubmittedQuestionWWW))
#12 /var/www/lib/Lampcms/ Controllers/Ask.php(81): Lampcms\Controllers\Ask-> process()
#13 /var/www/lib/Lampcms/WebPage. php(284): Lampcms\Controllers\Ask->main( )
#14 /var/www/www/index.php(122): Lampcms\WebPage->__construct( Object(Lampcms\Registry))
#15 {main}


My settings in the config:

server = "mongodb://127.0.0.2:27017"
db = "LAMPCMS"


 
Edited Sep 3, 2012 04:26 AM
new info
asked September 3, 2012 at 4:19 AM

 il
what connection collaction should I choose for the DB
flag
Sep 3, 2012 07:47 AM
collation should be utf-8 since all strings are utf-8.
flag
Sep 3, 2012 07:49 AM
utf8_general_ci ?
flag
Sep 3, 2012 07:50 AM
That's not really important, but utf8_general_ci is what I use.
flag
Sep 3, 2012 07:52 AM

1 Answer

0
Best answer
 
Actually this error probably means cannot connect to MySQL database, not Mongo. LampCMS uses MySQL in addition to Mongo to implement "Similar questions" feature and to implement the "Search" feature.
I chose to use MySQL for search because MySQL has full text search capability which makes it very easy to index questions.

All you need to do is to create an empty MySQL database and supply the connection details in the [DB] Section of !config.ini

You don't have to create any tables in MySQL, the program will create table automatically when it's first needed.

flag
answered September 3, 2012 at 7:40 AM
what connection collation should I choose for the DB
flag
Sep 3, 2012 07:48 AM

Your answer

Join with account you already have

FTTF

Preview

Alert