Jump to content

Recommended Posts

Posted

Hi guys,

 

First time user of Ubuntu looking for some advice.

 

I'm trying to transfer our Moodle from a Windows xampp installation to a new Ubuntu box.

 

The installation went fine, but since I copied the data from the old Moodle & MoodleData folders I now get the error: Error reading from database.

 

I have tried to import the old MySql database over using the plugin Adminer, but I'm not totally sure if it came across cleanly.

 

Can anyone offer any advice?

 

Many thanks,

Posted
check the database settings in config.php

 

you might need to change the database server to 127.0.0.1 to get it to read from the local machine.

 

Is that the section - $CFG->wwwroot =

 

?

Posted

no

$CFG->wwwroot is url of your moodle and will look like;

 

$CFG->wwwroot = 'http://moodle.midkent.ac.uk'; // url of your moodle

$CFG->dirroot = '/var/www/html/moodle27/'; // directory on the server that your moodle sits in

 

 

the database section of the config looks like the below

$CFG->dbtype = 'mysqli'; // 'pgsql', 'mariadb', 'mysqli', 'mssql', 'sqlsrv' or 'oci'

$CFG->dblibrary = 'native'; // 'native' only at the moment

$CFG->dbhost = '127.0.0.1'; // eg 'localhost' or 'db.isp.com' or IP

$CFG->dbname = 'moodle'; // database name, eg moodle

$CFG->dbuser = 'root'; // your database username

$CFG->dbpass = 'supersecret password!'; // your database password

$CFG->prefix = 'mdl_'; // prefix to use for all table names

  • Thanks 1
Posted

Ok - slightly different 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

 

I'm sure it's to do with MySQL. I'm a complete novice with it!

Posted

Do you have access to a command prompt on the ubuntu box? If so try logging in manually with the credentials :

 

mysql -u -p

 

(you should then be prompted for the db password).

 

If the db is not running properly, that will give an error.

Posted

ok next step from there is to enter

 

show databases;

 

 

this will show you the databases available on the server so you check your moodle one is there and what it's called

  • Thanks 1
Posted

Database

information_schema

moodle

mysql

performance_schema

 

 

As amateur as this sounds, I can't recall which of the moodle or mysql databases I'm using. Is there a way to find this out?

 

I still have a dump from the old server. Would it be just as easy to reinstall mysql and reimport?

Posted

cool so you've confirmed that you've got a database with stuff in it

you know the name of the database

you know that your database username and password work fine

 

so that points to a typo in your config.php file

  • Thanks 1
Posted

Massive thanks to @danbuntu (now known as 'The King of Linux' in our office) for his absolutely superb support with getting our ubuntu moodle server online.

 

Some of the things you were doing was mighty impressive!!

 

Regards,

 

Gardinho

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...