Linux服务器系统下如何进入MySQL命令行,码笔记分享进入MySQL命令行的方法:
Linux下进入MySQL命令行的方法
Linux系统下进入MySQL命令行主要有两种情况,即连接本机MySQL和连接远程主机上的MySQL
一:连接本机MySQL命令行
mysql -uroot -p
,回车后,输入密码即可。注意:
-uroot是指MySQL上的用户名root,而不是Linux的用户名root,如果想要登录MySQL上的用户mabiji,那就执行命令
mysql -umabiji -p
实例:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
[root@mabiji ~]# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 33 Server version: 5.5.57-log Source distribution Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> |
退出MySQL命令行(mysql>)执行命令:exit
即可。
二:连接远程主机MySQL命令行
mysql -h远程主机地址 -uroot -p
,回车后,输入密码即可。2023腾讯云服务器超便宜,这个价格太可以了,抓紧上车!
- 2核2G3M服务器30元/3个月:点此直达
- 2核2G3M服务器95元一年:点此直达
- 2核2G4M服务器112元/1年:点此直达
- 2核2G4M服务器396元/1年:点此直达
- 2核4G5M服务器168元/3年:点此直达
- 2核4G5M服务器628元/3年:点此直达
- 4核8G12M服务器446元/1年 518元15个月:点此直达
- 8核16G18M服务器1668元/15个月
- 16核32G28M服务器3468元/15个月
注意:以上特价轻量服务器限制条件为“产品首单特惠”,如果你的腾讯云账号已经是老用户,建议重新注册一个腾讯云账号,如果你是新用户符合条件,那么无脑入,这个CPU内存带宽配置,价格确实便宜,值得买!
2023云服务器降价了!阿里云VS腾讯云
阿里云:2023阿里云服务器价格便宜到家了(值得买)
腾讯云:2023腾讯云2核4G服务器8M带宽70元一年(多配置可选)
华为云:2023华为云优惠活动云服务器60元一年起(查看更多配置报价)
发表评论