## Installation help

### MySQLi extension

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

any ideas  or any help would be appreciated ...

Average of ratings: -
Re: MySQLi extension

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

DLLs are for Windows, not Ubuntu

Average of ratings: -
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: -
Re: MySQLi extension

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: -
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: -
Re: MySQLi extension

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: -
Re: MySQLi extension

I Fixed it by replacing the localhost with 127.0.0.1

Average of ratings: -