Installation help

MySQLi extension

 
 
Picture of lakshman tiriveedhi
MySQLi extension
 

when i restart my ubuntu server after setup of moodle i am getting this error 

Error: database driver problem detected

PHP has not been properly configured with the MySQLi extension so that it can communicate with MySQL. Please check your php.ini file or recompile PHP. MySQLi extension is not available for PHP 4.

i tried uncommenting the lines php_sql.dll and others in php.ini file but didnt work sad

any ideas  or any help would be appreciated ... 

 
Average of ratings: -
Picture of Howard Miller
Re: MySQLi extension
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

sudo apt-get install php5-mysqli
sudo service apache2 restart

DLLs are for Windows, not Ubuntu wink

 

 

 
Average of ratings: -
Picture of lakshman tiriveedhi
Re: MySQLi extension
 

i have already installed mysql what u suggested ,and after i restart the server it gave me another error 

Error: Database connection failed

It is possible that the database is overloaded or otherwise not running properly.

The site administrator should also check that the database details have been correctly specified in config.php

 
Average of ratings: -
Picture of Howard Miller
Re: MySQLi extension
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

The database settings in your config.php probably don't match the database you set up.

$CFG->dbhost - if the database is on the same machine then this is 'localhost', otherwise the name/IP of the database machine.

$CFG->dbname - the name you gave when you did 'CREATE DATABASE....'

$CFG->dbuser
$CFG->dbpass - the username and password you gave in the GRANT command. Make particularly sure you got the GRANT command right.

Make sure the database server is running. In particular, the following should work on the command line, using all the data above]

mysql -h dbhost -u dbuser -p dbname

(You should be asked for the password)

 
Average of ratings: -
Picture of lakshman tiriveedhi
Re: MySQLi extension
 

thanks for the quick reply.

i just tested with the info in config.php with that command it works .

and FYI ,i am using root as a user .

so any other ideas why its still showing this error ?

 
Average of ratings: -
Picture of Howard Miller
Re: MySQLi extension
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

Ok - you need to switch on Debugging. Copy Section 8 from config-dist.php into config.php and uncomment the debugging lines. Try again. Are they additional messages? You may need to look in your web server error log.

 
Average of ratings: -
Picture of lakshman tiriveedhi
Re: MySQLi extension
 
I Fixed it by replacing the localhost with 127.0.0.1 smile
 
Average of ratings: -