您好,欢迎来到客趣旅游网。
搜索
您的当前位置:首页MySQL学习笔记之进入_MySQL

MySQL学习笔记之进入_MySQL

来源:客趣旅游网

bitsCN.com

MySQL装有一个名为mysql的命令行,在提示符下输入mysql将出现如下的简单提示:

 ~ mysqlWelcome to the MySQL monitor. 
 Commands end with ; 
 or /g.Your MySQL connection id is 135Server version: 5.5.35-0ubuntu0.13.10.1 
 (Ubuntu)Copyright (c) 2000, 2013, Oracle and/or its affiliates. 
 All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. 
 Other names may be trademarks of their respectiveowners.
 Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.mysql>

mysql的命令行参数一般有:

-u 用户名

-p 密码

-h 主机名

-P 端口号

例如:mysql -u root -p -h localhost -P 3306

命令行会提示你输入密码

Enter password:

也可以直接输入密码,mysql -p123456 或者mysql --password=123456

进入mysql后,SHOW DATABASES显示数据库信息,USE DATABASE进入数据库,SHOW TABLES显示table信息。

要显示某一table的列信息,SHOW COLUMNS FROM table或者DESCRIBE table。

其它的SHOW用法:

SHOW STATUS:显示服务器信息

SHOW GRANTS:显示用户的权限

SHOW ERRORS,SHOW WARNINGS,显示错误或警告信息。

Copyright © 2019- kqyc.cn 版权所有 赣ICP备2024042808号-2

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务