Home > Database > Mysql Tutorial > Linux 下如何进入 MySQL 命令行

Linux 下如何进入 MySQL 命令行

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:09:48
Original
1153 people have browsed it

连接MySQL: 格式: mysql -h主机地址 -u用户名-p用户密码 1、例1:连接到本机上的MYSQL 找到mysql的安装目录,一般可以直接键入

连接MySQL:

格式: mysql -h主机地址 -u用户名-p用户密码

1、例1:连接到本机上的MYSQL

找到mysql的安装目录,一般可以直接键入命令mysql -uroot -p,,回车后提示你输密码,如果刚安装好MYSQL,超级用户root是没有密码的,故直接回车即可进入到MYSQL中了,MYSQL的提示符是:mysql>

2、连接到远程主机上的MySQL

假设远程主机的IP为:10.0.0.1,用户名为root,密码为123。则键入以下命令:

mysql -h10.0.0.1 -uroot -p123

(注:u与root可以不用加空格,其它也一样)

3、退出MySQL命令

exit (回车)

linux

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