Moodle MySQL and Login problem

Posted on 2011-10-13
Last Modified: 2012-05-12
We have a rather strange and urgent problem with moodle CMS and mysql since moving from one host to another.

Moodle works normally for guests and you can log into the front page as an admin but the moment we try to navigate we get logged out. In addition the moment you click turn editing on you immediately get logged out.

If we rebuild the site using the moodle installer all works fine (The installer creates a new database in INNODB utf8_unicode_ci.  but the moment we try to restore our database it all goes belly up again.

When we look at the database structure phpmyadmin the restored database is in MyISAM  format and Utf8_general_ci which i presume is the route of our problem.

We have tried converted the table structures to INNODB by exporting g the database and changing in notepad and reimporting (dropping the original database) but still no joy.  

Short of editing the collation setting for each table is there a quick way of changing the collation setting for all tables.

Or am i up the wrong tree altogether, any other suggestions?

Moodle 2.03
Question by:nazateam
    LVL 24

    Accepted Solution

    Strange indeed.  I assume moodle versions in old and new hosts are identical.  Can you try importing the backup to another database then copying the data over to the fresh moodle install?  Something like:

    Delete from freshdb.table1:
    Insert into freshdb.table1 select * from olddb.table1;

    I know there will be a lot of tables, but maybe you can create a script using the output of SHOW TABLES.

    Author Closing Comment

    Thanks for the help, kinda told me what i was expecting.

    Oh well that what happens when you get someone else to migrate a website for you. so wish i had done it myself now!.


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn how to count occurrences of each item in an array.

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now