Home > Database > Mysql Tutorial > MySQL数据库常用命令

MySQL数据库常用命令

WBOY
Release: 2016-06-07 16:46:17
Original
945 people have browsed it

MySQL数据库常用命令: 1)进入命令提示符 mysql -u [username] -p 2)查看数据库列表 show databases; 3)打开数据库 use [data

MySQL数据库常用命令:

1)进入命令提示符

mysql -u [username] -p

2)查看数据库列表

show databases;

3)打开数据库

use [database_name]

4)查看表列表

show tables;

5)执行脚本文件

mysql -u[username] -p[password] [database_name]

6)重定向表查询输出到文件

mysql -u[username] -p[password] [database_name]

7)插入普通用户

insert into user (Host, User, Password, ssl_cipher, x509_issuer, x509_subject) values ('localhost', 'cmSUSEr', password('Passwd01'), '', '', '');
insert into db values ('localhost', 'cms', 'cmsuser', 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');

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