MySQL常用命令合集(Mac版)

mysql信息

  • MySQL位置
shell 复制代码
which mysql
  • 查看版本
shell 复制代码
mysql --version

启动与关闭

使用mysql.server启用脚本来执行,默认在/usr/local/mysql/support-files这个目录中。

  • 启动
shell 复制代码
sudo /usr/local/mysql/support-files/mysql.server start
  • 关闭
shell 复制代码
sudo /usr/local/mysql/support-files/mysql.server stop
  • 重启
shell 复制代码
sudo /usr/local/mysql/support-files/mysql.server restart
  • 查看状态
shell 复制代码
sudo /usr/local/mysql/support-files/mysql.server status

登录

shell 复制代码
mysql -u root -p
## 回车之后,再输入密码
相关推荐
Elastic 中国社区官方博客1 天前
现已正式发布: Elastic Cloud Hosted 上的托管 OTLP Endpoint
大数据·运维·数据库·功能测试·elasticsearch·全文检索
2501_908329851 天前
使用Python自动收发邮件
jvm·数据库·python
heimeiyingwang1 天前
【架构实战】数据库分库分表实战
数据库·架构
爬山算法1 天前
MongoDB(60)如何使用explain命令?
数据库·mongodb
2501_908329851 天前
NumPy入门:高性能科学计算的基础
jvm·数据库·python
瀚高PG实验室1 天前
数据库因坏块导致无法VACUUM FREEZE问题处理
数据库·瀚高数据库
gechunlian881 天前
Redis简介、常用命令及优化
数据库·redis·缓存
ahauedu1 天前
MySQL 8.0+ 默认使用 caching_sha2_password 插件进行密码加密
数据库·mysql
CoderIsArt1 天前
编译器构建中涉及的算法
数据库·算法
IvorySQL1 天前
从代码到舞台:HOW 2026 致敬 PostgreSQL 18 贡献者
数据库·postgresql·开源