I have 2-3 views defined in mysql, each taking data from 3-4 tables.
These views are running perfectly fine on my local machine, both using the old php script and the new one using YII.
However on the server, the YII script generates the following error.
CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1142 SHOW VIEW command denied to user 'xxx_xxx'@'localhost' for table 'herb_price_list'
Where herb_price_list is a view
Viewable here
Googling this error suggests that this had occurred in Prado and upgrading resolved this.
But alas, nothing happens in YII, as upgrading to 1.1.5 does no good.
Further googling suggests its a syntax error pertaining to Mysql Version 5.0.xx and mysql 5.2 has resolved this. I checked, my linux host is running 5.0 community, but my local machine is running mysql 5.1.xx and is working great in it.
Further checking revealed that my old script is still working on the same server,
Visible here
This roles out mysql, linux, and windows from the scenerio, leaving only YII as causing factor.
Your old code maybe does not use that command "SHOW VIEW"… and the other3 queries can be anything else other that the command "SHOW VIEW"…
If you have phpMyAdmin than for the user permissions you will see that there is a option/permission SHOW VIEW under structure… so it’s still possible that your user does not have that permission… at least you should check this…
Or at least… if you know the password for the root user… try to run the application with the root mysql permissions…