Errors on Server after FTPing local files ... case issues maybe?
Permalink
I'm getting an error message when I try to view my C5 site on the server. I am a brand-new Newbie, FYI, so I may have overlooked something. It's saying that it can't find the table Packages, but it's there - I can see it.
An unexpected error occurred.
An exception occurred while executing 'SELECT t0.pkgID AS pkgID_1, t0.pkgHandle AS pkgHandle_2, t0.pkgVersion AS pkgVersion_3, t0.pkgIsInstalled AS pkgIsInstalled_4, t0.pkgAvailableVersion AS pkgAvailableVersion_5, t0.pkgDescription AS pkgDescription_6, t0.pkgDateInstalled AS pkgDateInstalled_7, t0.pkgName AS pkgName_8 FROM Packages t0 WHERE t0.pkgIsInstalled = ? ORDER BY t0.pkgID ASC' with params [1]: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bkuehn.Packages' doesn't exist
I noticed that the table is named packages, lower case, but it's looking for Packages on the server. Why is this? How do I fix this?
I didn't change any of the code on my local server, so I'm not sure why this is happening.
Thank you...
An unexpected error occurred.
An exception occurred while executing 'SELECT t0.pkgID AS pkgID_1, t0.pkgHandle AS pkgHandle_2, t0.pkgVersion AS pkgVersion_3, t0.pkgIsInstalled AS pkgIsInstalled_4, t0.pkgAvailableVersion AS pkgAvailableVersion_5, t0.pkgDescription AS pkgDescription_6, t0.pkgDateInstalled AS pkgDateInstalled_7, t0.pkgName AS pkgName_8 FROM Packages t0 WHERE t0.pkgIsInstalled = ? ORDER BY t0.pkgID ASC' with params [1]: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bkuehn.Packages' doesn't exist
I noticed that the table is named packages, lower case, but it's looking for Packages on the server. Why is this? How do I fix this?
I didn't change any of the code on my local server, so I'm not sure why this is happening.
Thank you...
This happens if you don't configure MySQL/MariaDB case sensitivity correctly before installing c5 on a Windows machine. I think a soon-to-be-released version of c5 is going to check for this condition prior to installation.
Gondwana, I just started using C5 ... as of a week ago. I'm a total Newbie. What steps should I take before setup locally on my windows machine? I've found very little information about this online, so any help is much appreciated. My first C5 site ... and it's not working on the server. :(
Yes, this really needs to be documented/handled better (and that's going to happen).
In short, you need to find the relevant my.ini file on Windows (which MAY be in mysql/bin), and change or set lower_case_table_names=2.
Unfortunately, this won't make any changes to pre-existing databases, but will ensure that databases created in future will work on linux. I've read of a few ways to convert pre-existing databases, but if you haven't gone very far, it may be easier to start afresh.
In short, you need to find the relevant my.ini file on Windows (which MAY be in mysql/bin), and change or set lower_case_table_names=2.
Unfortunately, this won't make any changes to pre-existing databases, but will ensure that databases created in future will work on linux. I've read of a few ways to convert pre-existing databases, but if you haven't gone very far, it may be easier to start afresh.
You know ... I discovered that today, and I have edited my my.ini file accordingly, and it worked! However, that's not going to take care of the files on the server, where it's not working. I have gone through the add-on migration plugin, and have renamed the files, and have compared them one by one - local copy against server, and they're all correct. I have ZERO idea what to do now... :/
Renaming the tables isn't the whole story. Table names are also used to specify foreign key relationships. I'm loathe to suggest surgery on those; I wouldn't risk it.
However, if you dump the database into a .sql file, you might be able to spot the incorrect references (you can open a .sql file in any text editor). It might be possible to change them and then import the modified file.
Alternatively, I've read that exporting the database with the original my.ini setting, then re-importing it with the new my.ini setting, can fix it. I'm sceptical.
You'd want to have a fair bit invested in your current site to want to try these things. If you do, keep backups lest things get worse.
And I'm not 100% sure that case sensitivity is the root cause of the problem you're seeing.
However, if you dump the database into a .sql file, you might be able to spot the incorrect references (you can open a .sql file in any text editor). It might be possible to change them and then import the modified file.
Alternatively, I've read that exporting the database with the original my.ini setting, then re-importing it with the new my.ini setting, can fix it. I'm sceptical.
You'd want to have a fair bit invested in your current site to want to try these things. If you do, keep backups lest things get worse.
And I'm not 100% sure that case sensitivity is the root cause of the problem you're seeing.