Home > Database > Mysql Tutorial > body text

MySQL指令_MySQL

WBOY
Release: 2016-06-01 13:06:55
Original
913 people have browsed it

启动mysql服务

1、如果你已经安装了MySQLStartupItem.pkg,重新启动电脑即可。

2、如果你有安装MySQLStartupItem.pkg或者不想启动电脑,运行:应用程序-实用工具-终端,在终端中输入命令:sudo /Library/StartupItems/MySQLCOM/MySQLCOM start,然后输入你的系统管理员密码即可。

关闭mysql服务

终端中输入命令:sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop,然后输入你的系统管理员密码即可。

你也可以去系统偏好设置-其他-MySQL,通过这个来启动和停止MySQL服务。

更改mysql root账户密码

终端中输入命令:/usr/local/mysql/bin/mysqladmin -u root password 新密码

你可以随时使用这条命令更改你的密码。

终端登录mysql

终端登录mysql

方法1:绝对路径

终端中输入命令:/usr/local/mysql/bin/mysql -u root -p

提示:输入你的新密码


方法2:(推荐)相对路径

终端中输入命令:

查看路径中有没有需要的路径:

终端中输入命令:echo $PATH

没有,继续

添加需要路径:PATH="$PATH":/usr/local/mysql/bin

以后

终端中需输入命令:mysql -u root -p 即可

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template