您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

MySQL学习记录1

bubuko 2022/1/25 20:02:14 mysql 字数 7024 阅读 627 来源 http://www.bubuko.com/infolist-5-1.html

C:\Users\Administrator>mysql -u root -proot #進入MySQL ,另外 -p 回車再輸入密碼,就會隱藏密碼 mysql> #查庫 mysql> show databases; + + | Database | + + | information_schema ...
C:\Users\Administrator>mysql -u root -proot  #進入MySQL  ,另外 -p 回車再輸入密碼,就會隱藏密碼



mysql> #查庫
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| challenges         |
| liweigan           |
| ly                 |
| mysql              |
| performance_schema |
| security           |
| test               |
+--------------------+
8 rows in set (0.00 sec)

mysql> #要使用一個庫才能查表
mysql> #使用庫
mysql> use security;
Database changed
mysql> #查表
mysql> show tables;
+--------------------+
| Tables_in_security |
+--------------------+
| emails             |
| referers           |
| uagents            |
| users              |
+--------------------+
4 rows in set (0.00 sec)

mysql> #查表的結構
mysql> desc users;
+----------+-------------+------+-----+---------+----------------+
| Field    | Type        | Null | Key | Default | Extra          |
+----------+-------------+------+-----+---------+----------------+
| id       | int(3)      | NO   | PRI | NULL    | auto_increment |
| username | varchar(20) | NO   |     | NULL    |                |
| password | varchar(20) | NO   |     | NULL    |                |
+----------+-------------+------+-----+---------+----------------+
3 rows in set (0.02 sec)


#查当前使用的库用函数
database()
#查看当前使用的用户
user()

 

MySQL学习记录1

原文:https://www.cnblogs.com/cat2020/p/12582762.html


如果您也喜欢它,动动您的小指点个赞吧

除非注明,文章均由 laddyq.com 整理发布,欢迎转载。

转载请注明:
链接:http://laddyq.com
来源:laddyq.com
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


联系我
置顶