mysql登陆的命令格式为:?

1

mysql -h [hostip] -u [username] -p [password] [database]

mysql -h [hostip] -u [username] -p [password] [database]

1.普通登陆mysql数据库

命令格式:mysql -u 用户名 -p 密码,例如: mysql -u root -p root

如果在-p后没有提供密码,则会在执行命令后要求用户输入密码

2.制定端口号登陆,mysql的默认端口号是3306,

命令格式:mysql -u 用户名 -p 密码 -P 端口号

即可,注意指定端口的字母P为大写,而标识密码的p为小写。

3.指定IP地址和端口号登录MySQL数据库

命令格式为:mysql -h ip -u 用户 -p -P 端口号

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

4.制定数据库登陆

mysql -h ip地址 -u 用户名 -p 密码 数据库名

例如:mysql -h 127.0.0.1 -u root -p test

查看当前登陆用户和数据库

?

1

2

select user();

select database();

select user();

select database();

退出登陆命令

登陆进入mysql进入之后,可能到下面的提示信息,可以help看看输出结果?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

mysql> help

For information about MySQL products and services, visit:

http://www.mysql.com/

For developer information, including the MySQL Reference Manual, visit:

http://dev.mysql.com/

To buy MySQL Enterprise support, training, or other products, visit:

https://shop.mysql.com/

List of all MySQL commands:

Note that all text commands must be first on line and end with';'

?     (\?) Synonymfor `help'.

clear   (\c) Clear the current input statement.

connect  (\r) Reconnect to the server. Optional arguments are db and host.

delimiter (\d) Set statement delimiter.

edit   (\e) Editcommand with $EDITOR.

ego    (\G) Sendcommand to mysql server, display result vertically.

exit   (\q) Exit mysql. Same as quit.

go    (\g) Sendcommand to mysql server.

help   (\h) Display this help.

nopager  (\n) Disable pager, print to stdout.

notee   (\t) Don't write into outfile.

pager   (\P) Set PAGER [to_pager]. Print the query results via PAGER.

print   (\p) Print currentcommand.

prompt  (\R) Change your mysql prompt.

quit   (\q) Quit mysql.

rehash  (\#) Rebuild completion hash.

source  (\.) Execute an SQL scriptfile. Takes afile name as an argument.

status  (\s) Get status information from the server.

system  (\!) Execute a system shellcommand.

tee    (\T) Set outfile [to_outfile]. Append everything into given outfile.

use    (\u) Use another database. Takes database name as argument.

charset  (\C) Switch to another charset. Might be neededfor processing binlog with multi-byte charsets.

warnings (\W) Show warnings after every statement.

nowarning (\w) Don't show warnings after every statement.

resetconnection(\x) Clean session context.

For server side help,type 'help contents'

mysql> help

For information about MySQL products and services, visit:

http://www.mysql.com/

For developer information, including the MySQL Reference Manual, visit:

http://dev.mysql.com/

To buy MySQL Enterprise support, training, or other products, visit:

https://shop.mysql.com/

List of all MySQL commands:

Note that all text commands must be first on line and end with ';'

? (\?) Synonym for `help'.

clear (\c) Clear the current input statement.

connect (\r) Reconnect to the server. Optional arguments are db and host.

delimiter (\d) Set statement delimiter.

edit (\e) Edit command with $EDITOR.

ego (\G) Send command to mysql server, display result vertically.

exit (\q) Exit mysql. Same as quit.

go (\g) Send command to mysql server.

help (\h) Display this help.

nopager (\n) Disable pager, print to stdout.

notee (\t) Don't write into outfile.

pager (\P) Set PAGER [to_pager]. Print the query results via PAGER.

print (\p) Print current command.

prompt (\R) Change your mysql prompt.

quit (\q) Quit mysql.

rehash (\#) Rebuild completion hash.

source (\.) Execute an SQL script file. Takes a file name as an argument.

status (\s) Get status information from the server.

system (\!) Execute a system shell command.

tee (\T) Set outfile [to_outfile]. Append everything into given outfile.

use (\u) Use another database. Takes database name as argument.

charset (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets.

warnings (\W) Show warnings after every statement.

nowarning (\w) Don't show warnings after every statement.

resetconnection(\x) Clean session context.

For server side help, type 'help contents'

通过输出信息,我们知道如下三条退出mysql的命令

1. exit

2. quit

3. \q

到此这篇关于mysql的登陆和退出命令格式的文章就介绍到这了,

mysql怎么退出电脑_mysql的登陆和退出命令格式相关推荐

  1. Mysql -uroot -p 登陆不上_mysql的登陆和退出命令格式

    mysql登陆的命令格式为: mysql -h [hostip] -u [username] -p [password] [database] 1.普通登陆mysql数据库 命令格式:mysql -u ...

  2. mysql连接28000错误代码_mysql 在登陆的时候出现error 1045 (28000): 错误解决办法

    错误显示:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 解决方案: 1.找到配 ...

  3. 从其他电脑拷mysql到自己电脑_mysql 数据库复制到其他电脑

    诶?这项技术又是什么玩意(What)? 这项技术为什么会存在?我们已经有那么多解决方案(Method)了,我们为什么要用它(Why)? 如果这项技术那么好且我们正好有场景可以用到这项技术,且能使我们的 ...

  4. mysql登录密码特殊字符_mysql密码中有特殊字符在命令行下登录的操作

    使用MySQL过程中,我们经常会对一个字段进行排序查询,我们一般都是想要按照中文拼音首字母进行依次排序,但mysql中进行中文排序的时候,对汉字的排序结果往往都是错误的.这种情况 2021-02-04 ...

  5. mysql配置向导文件_Mysql的安全配置向导命令mysql_secure_installation

    [root@youxi1 ~]# mysql_secure_installation Securing the MySQL server deployment. Enter password for ...

  6. 锁定计算机游戏怎么就退出,电脑玩游戏老是自动退出了是为什么

    一.检查CPU和显卡散热,除尘,上油,或更换风扇. 二.电源电压不稳,电源功率不足,更换质量高的功率大的电源. 三.清理磁盘和整理磁盘碎片. 1.在我的电脑窗口,右击要清理的盘符-"属性&q ...

  7. mysql存储过程日期类型_mysql中多种日期类型的格式话---用存储过程实现

    其中三个参数:数据库名,表名,列名 temp_d_name:数据库名 temp_t_name:表名 temp_c_name:列名 CREATE DEFINER=`root`@`localhost` P ...

  8. mysql 5.7 安装_MySQL 5.7 的安装历程

    mysql5.7零基础入门级的安装教程: 安装环境:Windows 10, 64 位(联想拯救者R720) 安装版本:mysql-5.7.25-winx64 一.下载 1.进入官网 首先,下载MySQ ...

  9. mysql 备份的权限_MySQL的权限设置和备份还原

    MySQL数据库系统的维护工作主要包括用户权限的设置.数据库的备份与恢复,本篇博客将对进行这些操作进行讲解 数据库的用户授权 MySQL数据库的root用户账号拥有对所有库.表的全部权限,频繁使用ro ...

最新文章

  1. Window Function--the function of window function
  2. 加密解密php,2个比较经典的PHP加密解密函数分享
  3. LinkedBlockingQueue的put,take方法
  4. mysql 密码hash算法_如何用hash创建一个mySQL用户(‘sha256’,$salt.$password)?
  5. 一步一步教你Pycharm的配置Python环境
  6. Linux中pam认证详解,linux中pam认证解析
  7. 数据中台公开课丨可以复用的中台架构建设经验与实践
  8. win10总是2分钟就自动睡眠怎么办 win10系统自动休眠bug怎么解决(转)
  9. 步进电机基础(5.9)-步进电机的驱动与控制-三相步进电机的驱动电路
  10. 典型相关分析(SPSS)
  11. mysql查询各科成绩前三名_mysql巧用连表查询各科成绩前三名
  12. JS基础——图片切换的综合实例
  13. JAVA 115个面试题及个人部分衍生疑问?
  14. 用python-turtle优雅的画椭圆
  15. SourceTree + Gerrit
  16. hibernate学习笔记(总结)
  17. Cypress代理铁电存储器FM25V10-GTR中文资料
  18. 使用MVC模式实现一个超简单的网上书店系统
  19. PAT练习 星际密码
  20. 谷歌中国发布年度热榜 iPhone成全球最流行词

热门文章

  1. 使用客户端登陆ftp 500 OOPS: cannot change directory:/home/virftp解决
  2. MyEclipse 2015 CI
  3. AVR 定点数运算程序设计及数制转换
  4. 更为简单的Ctrl+S自动刷新浏览器工具-LinrF5
  5. JSON DATE 转换标准的一些资料(收集)
  6. 灾难,让我们靠的更近!
  7. SVN A C D M G U R I的含义
  8. Aspose.Words for .NET
  9. java 不指定大小接收
  10. 如何才能做到网站高并发访问?