mysql CREATE VIEW 无法从 mysql_query 工作
我有一个在 mysql 数据库中创建 VIEW 的代码,该代码在我的本地服务器上运行良好。 它可以正常创建和裁剪视图。但在我的在线服务器上,它给出了
"CREATE VIEW command denied to user"
在线数据库的错误,我在数据库表单 PHPmyAdmin [Myadmin 位于本地主机在线] 中手动创建 VIEW,因此我有权在在线数据库上创建 VIEW。
但是对于 php mysql_query
,它会给出 command returned
错误。是否有任何服务可以使用 php.ini 创建视图?
I have a code to create VIEW in mysql database which is working fine on my local server.
It creates and crop view normally. But on my Online server it gives error
"CREATE VIEW command denied to user"
for online database I manually create VIEW in Database form PHPmyAdmin [Myadmin is in localhost online] it creating, SO i have permission to create VIEW on online database.
But with php mysql_query
it is giving command denied
error. is there any service to be on for creating view with php.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
此消息表示用户没有足够的权限来创建视图。权限被授予特定用户@特定主机。您必须
在主机是执行 CREATE VIEW 的主机名的情况下
执行此外,用户必须对涉及的所有选项卡和列具有 SELECT 权限
This message says that user doesn't have enough permissions to create view. Permissions are granted to particular user @ particular host. You must execute
where host is hostname from where your CREATE VIEW is executed
Also, user must have SELECT privilages on all tabels and columns involved
我是从 CPanel / phpMyAdmin Web 界面执行此操作的,因为我的创建脚本中嵌入的数据库名称与我的 WordPress mysql 数据库不同。即“创建视图
博客
。vwMyView
....”。我的计算机上有一个名为
blog
的本地 MySql 数据库,它与我的 WordPress MySQL 数据库不同。因此,它自然会给出安全错误,而不是说数据库无效。我真傻,没有早点发现它。I was doing this from CPanel / phpMyAdmin web interface because my create script had the name of the database embedded in it that was not the same as my wordpress mysql database. I.e "CREATE VIEW
blog
.vwMyView
....".I had a local MySql Database on my computer that was named
blog
, which was different than my WordPress MySQL database. So naturally it gives an security error instead of saying the database was invalid. Silly me for not catching it sooner.