# Switching from SQLite 3 to MySQL DB gives strange redirects

**URL:** <https://www.ruby-forum.com/t/switching-from-sqlite-3-to-mysql-db-gives-strange-redirects/186344>\
**Category:** Rails\
**Created:** [April 5, 2010, 11:54am UTC](https://www.ruby-forum.com/t/switching-from-sqlite-3-to-mysql-db-gives-strange-redirects/186344 "2010-04-05T11:54:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Blaise](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ecae2f/32.png) [@Blaise](https://www.ruby-forum.com/u/Blaise)\
**Post date:** [April 5, 2010, 11:54am UTC](https://www.ruby-forum.com/t/switching-from-sqlite-3-to-mysql-db-gives-strange-redirects/186344/1 "2010-04-05T11:54:15Z")

</div>

Hi there,

I have a site that’s been running for a few years now and I want to  
change the Database to MySQL from SQLite,

Using yaml\_db I performed the migration fairly seamlessly, and have  
the site up and running with all my data in MySQL now, however I have  
a few problems on a couple of authenticated areas of my site.

I have an admin section, and when I try and log in, I don’t receive  
any errors but return to the login page, the log shows this…

“Filter chain halted as [:authorize] rendered\_or\_redirected.”

I’m not sure why I’m getting this redirect because if I edit the  
database.yml config file to use my SQLite DB again and retry logging  
in, it will accept, so this would mean to me that it isn’t an issue  
with my before\_filters or routes.rb.

Can anyone shed any light on what might be causing this?, I’m using  
Rails 2.3.5

Cheers,

Blaise.

---

<div class="post-metadata">

**Author:** ![Blaise](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ecae2f/32.png) [@Blaise](https://www.ruby-forum.com/u/Blaise)\
**Post date:** [April 5, 2010, 6:31pm UTC](https://www.ruby-forum.com/t/switching-from-sqlite-3-to-mysql-db-gives-strange-redirects/186344/2 "2010-04-05T18:31:04Z")

</div>

On Apr 5, 2010, at 2:36 AM, Blaise wrote:

> any errors but return to the login page, the log shows this…
> 
> “Filter chain halted as [:authorize] rendered\_or\_redirected.”
> 
> I’m not sure why I’m getting this redirect because if I edit the  
> database.yml config file to use my SQLite DB again and retry logging  
> in, it will accept, so this would mean to me that it isn’t an issue  
> with my before\_filters or routes.rb.
> 
> Can anyone shed any light on what might be causing this?, I’m using  
> Rails 2.3.5

You need to examine the code in the :authorize filter and see why it’s  
returning false. Run the queries it is running and see what happens.

My guess is that you’ve got a boolean field somewhere that sqlite  
thinks is true, but mysql thinks is false.

or something similar.

---

<div class="post-metadata">

**Author:** ![Blaise](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ecae2f/32.png) [@Blaise](https://www.ruby-forum.com/u/Blaise)\
**Post date:** [April 6, 2010, 7:53pm UTC](https://www.ruby-forum.com/t/switching-from-sqlite-3-to-mysql-db-gives-strange-redirects/186344/3 "2010-04-06T19:53:37Z")

</div>

I wanted to test it out to see how it performed, generally it was  
pretty good. however it failed at performing multiple transactions,  
naturally this isn’t great for a web app.

---

<div class="post-metadata">

**Author:** ![Blaise](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ecae2f/32.png) [@Blaise](https://www.ruby-forum.com/u/Blaise)\
**Post date:** [April 5, 2010, 6:35pm UTC](https://www.ruby-forum.com/t/switching-from-sqlite-3-to-mysql-db-gives-strange-redirects/186344/4 "2010-04-05T18:35:45Z")

</div>

On 5 April 2010 10:36, Blaise [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi there,
> 
> I have a site that’s been running for a few years now and I want to  
> change the Database to MySQL from SQLite,

Is that a good idea? I don’t think sqlite is recommended for deployed  
systems.

Colin
