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
## 回车之后,再输入密码