简体   繁体   English

DMBS:与PhpMyAdmin和MySql opninons的并集,交集和差异

[英]DMBS: Union, intersection and difference with PhpMyAdmin and MySql opninons

I'm learning SQL and some friend adviced me to instal XAMPP as it's all preconfigured and ready to use. 我正在学习SQL,一些朋友建议我安装XAMPP,因为它已经预先配置好并可以使用。 Well, I installed it and now I created 2 databases on which I exercise through PhpMyAdmin. 好吧,我安装了它,现在我创建了2个数据库,可以通过PhpMyAdmin对其进行练习。 That said, I'm trying to do 2 things: 也就是说,我正在尝试做两件事:

a)Sets OperationsUnion, Intersect, Difference. a)设置OperationsUnion,相交,差。 The only available in PhpMyAdmin (and therefore MySql I guess, since I noticed that PhpMyAdmin is based on MySql) is UNION. PhpMyAdmin(因此我猜是MySql,因为我注意到PhpMyAdmin基于MySql)中唯一可用的是UNION。 INTERSECT AND DIFFERENCE keywords do not exist. INTERSECT AND DIFFERENCE关键字不存在。 How to do that then? 那怎么办呢?

b)Using directly mysql.exe console. b)直接使用mysql.exe控制台。 I try to use commands like USE databasename and so on, but it says "Access denied to user ''@'localhost to 'databasename' 我尝试使用诸如USE databasename之类的命令,但是它说“拒绝访问用户'@'localhost到'databasename'

I tried to put connect commands in all the flavours possible (connect user pass host db, connect user pass db, and all kind of combinations) but with no avail. 我试图以各种可能的方式放置connect命令(connect user pass host db,connect user pass db和所有种类的组合),但无济于事。

How to do that? 怎么做? Seems like Phpmyadmin set his own passwords for the databases. 似乎Phpmyadmin为数据库设置了自己的密码。 I put empty password and checked in the Phpmyadmin that those password were empty passwords. 我输入了空密码,并在Phpmyadmin中检查了这些密码是否为空密码。 What I am doing wrong? 我做错了什么?

UNION keyword work perfectly fine on phpmyadmin. UNION关键字在phpmyadmin上运行良好。 Phpmyadmin is just an interface for MySQL. Phpmyadmin只是MySQL的界面。 Try to use "SQL" view in phpmyadmin to directly test your SQL queries. 尝试在phpmyadmin中使用“ SQL”视图直接测试您的SQL查询。

If it comes to mysql.exe, try to connect using a user eg root@localhost . 如果是mysql.exe,请尝试使用root@localhost用户进行连接。 By default there should be no password for root. 默认情况下,root用户没有密码。

a) UNION is a MySQL keyword that is a union of two queries. a) UNION是一个MySQL关键字,它是两个查询的并集。 This is different than the union , intersection , and difference concepts , which are all achieved through JOIN s. 这不同于并交集差异 概念 ,这些概念都是通过JOIN实现的。 This may help explain 这可能有助于解释

b) As for your password, the username probably defaults to root , but it could be something else. b)至于您的密码,用户名可能默认为root ,但也可能是其他名称。 If you didn't set it up, the password is probably empty string. 如果未设置,则密码可能为空字符串。 Maybe try running xampp\\mysql\\resetroot.bat 也许尝试运行xampp\\mysql\\resetroot.bat

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM