You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# On macOS Sierra & OSX to start/stop/restart MySQL post 5.7 from the command line:
$ sudo launchctl load -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
$ sudo launchctl unload -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
# On OS X to start/stop/restart MySQL pre 5.7 from the command line:
$ sudo /usr/local/mysql/support-files/mysql.server start # 启动
$ sudo /usr/local/mysql/support-files/mysql.server stop # 关闭
$ sudo /usr/local/mysql/support-files/mysql.server status # 查看状态
# Run the server in safe mode(注意不要漏了字母“l“)
$ sudo mysqld_safe
# Run the server in safe mode with privilege bypass
$ sudo mysqld_safe --skip-grant-tables
# 退出mysqld_safe(需新建终端窗口)
$ /usr/local/mysql/bin/mysqladmin -u root -p shutdown
$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 795
Server version: 5.7.28
Copyright (c) 2000, 2019, 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> QUIT;
Bye
The text was updated successfully, but these errors were encountered:
环境:
一、安装 MySQL 5.7.28
参考:
下载 .dmg 安装包,进行包安装,安装过程中全部选择默认即可。
在软件包安装程序过程中,
/usr/local/mysql
将自动创建指向安装过程中创建的特定于版本/平台的目录的符号链接 。MySQL 启动/关闭/查看状态
# On macOS Sierra & OSX to start/stop/restart MySQL post 5.7 from the command line: $ sudo launchctl load -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist $ sudo launchctl unload -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
二、连接 MySQL 5.7.28
参考:
语法:
在运行着 mysql 的用户名为 root 的本机电脑上连接 mysql:
The text was updated successfully, but these errors were encountered: