Home > Database > Mysql Tutorial > body text

Linux下MySQL命令

WBOY
Release: 2016-06-07 16:55:15
Original
924 people have browsed it

一、总结一下Linux下MySQL的一些命令:1.Linux下启动mysql的命令: mysqladmin start /ect/init.d/mysql start (前面为mysql的安

一、总结一下Linux下MySQL的一些命令:

1.Linux下启动mysql的命令:
mysqladmin start
/ect/init.d/mysql start (前面为mysql的安装路径)

2.Linux下重启mysql的命令:
mysqladmin restart
/ect/init.d/mysql restart (前面为mysql的安装路径)

3.Linux下关闭mysql的命令:
mysqladmin shutdown
/ect/init.d/mysql shutdown (前面为mysql的安装路径)

4.连接本机上的mysql:
进入目录mysql\bin,再键入命令mysql -uroot -p,, 回车后提示输入密码。
退出mysql命令:exit(回车)

5.修改mysql密码:
mysqladmin -u用户名 -p旧密码 password 新密码
或进入mysql命令行SET PASSWORD FOR root=PASSWORD("root");

6.增加新用户。(注意:mysql环境中的命令后面都带一个分号作为命令结束符)
grant select on 数据库.* to 用户名@登录主机 identified by "密码"
如增加一个用户test密码为123,让他可以在任何主机上登录, 并对所有数据库有查询、插入、修改、删除的权限。首先用以root用户连入mysql,然后键入以下命令:
grant select,insert,update,delete on *.* to " Identified by "123";

linux

Related labels:
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