MySQL--基本操作

MySQL参数
-u 用户名
-p 用户名密码
-V(大写) MySQL数据库版本信息
-h 主机地址
exit或者quit或者\q MySQL退出命令
在CMD命令中登录MySQL
1、打开CMD(快捷键win键+r)
2、回车键
3、输入‘mysql -u root -p’
4、回车键
5、输入密码
6、回车键
‘Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 45
Server version: 8.0.41 MySQL Community Server - GPL //MySQL版本信息

Copyright (c) 2000, 2025, Oracle and/or its affiliates.

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.’
显示以上内容,表示登录成功!!!

在CMD命令中启动MySQL服务
net start mysqlid 例:net start mysql80
在CMD命令中关闭MySQL服务
net stop mysqlid 例:net stop mysql80

posted @ 2025-06-20 09:18  rookie886  阅读(14)  评论(0)    收藏  举报