mysql内置数据库

1  mysql本地连接数据库

  >mysql -h localhost -u root -proot    注意-p后面没有空格,是直接跟上密码

  或者

  >mysql -h localhost -u root -p

  Enter password     提示数据密码

 

2  mysql远程连接数据库

  注意: mysql数据库要允许远程连接,否则是连接不上的

  2.1 通过navicat工具连

  2.2 命令行远程连接

    >mysql -h  ip -P 3306 -u root  -proot

 

3  mysql的内置数据库

  当安装上mysql时,就自动创建了几个数据库

  

    information_schema库中存放了服务器所维护的所有其他数据库的信息,如数据库名,数据库的表,表栏位,以及权限等,也就是这个库中放了整个数据库的一些基本的信息。

  其中有几个重要的表

  1)  information_schema.SCHEMATA  存放了所有的数据库名

    select  SCHEMA_NAME from information_schema.SCHEMATA  查看所有的数据库

 

  2)  information_schema.TABLES  存放了所有数据库的表名

    select table_name from information_schema.TABLES where information_schema.TABLES.table_schema='xxx'  查看某个数据的所有表

    select table_name from information_schema.TABLES where information_schema.table_schema='xxx' limit [N],1;  一个个的表的看

  information_schema.CLOUMNS  存放了所有数据库的列名

    select cloumn_name from information_schema.Columns where table_schema='xxx' and table_name='yyy' 查看xxx库yyy表的所有列

    select cloumn_name from information_schema.Columns where table_schema='xxx' and table_name='yyy'   limit [N],1;  一列列的看

    

    

 

 

 

    

转载于:https://www.cnblogs.com/uolo/p/7124200.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值