MYSQL企业级应用(三)基本管理
2018-01-03 19:24
459 查看
3.1数据库连接管理
登录数据库系统
在命令行中登录mysql数据库管理系统,其中“-h”参数指连接的主机名,因为此处是连接本机,所以后面的内容为localhost;“-u”参数表示用户名,此处的用户名为root:“-p”参数指用户密码。按下回车键显示输入密码提示
3.2数据库的启动流程图介绍
3.3 mysql命令,接口自带功能(常用举例)
\h或help或?
**mysql> \h #?号的效果相同的
3.4\Gmysql中在sql语句后面加\G表示将查询结果按列打印,默认情况下,mysql的查询结果是横向输出的,第一行是列头,后面是记录集,
3.5\c或者CTRL+c 这里表示的是取消的意思
3.6mysql命令,source命令使用
在mysql中处理文件
如果这些文件包含sql语句,则称为“脚本文件”,“批处理文件”
使用SOURCE命令
3.7 mysql数据库的关闭
方法一:
方法二:
方法三:
第四种方法是利用系统进程管理命令关闭mysql
kill pid #这里的pid为数据库服务对应的进程号
killall mysqld #这里的mysqld是数据库对应的进程名字
pkill mysqld #这里的mysqld是数据库服务对应的进程名字
3.8my.cnf配置文件说明
影响到服务器进程的启动
影响到客户端程序
mysql程序主配置文件
3.9配置文件读取过程
登录数据库系统
在命令行中登录mysql数据库管理系统,其中“-h”参数指连接的主机名,因为此处是连接本机,所以后面的内容为localhost;“-u”参数表示用户名,此处的用户名为root:“-p”参数指用户密码。按下回车键显示输入密码提示
mysql -h localhost -u root -p
3.2数据库的启动流程图介绍
3.3 mysql命令,接口自带功能(常用举例)
\h或help或?
**mysql> \h #?号的效果相同的
For information about MySQL products and services, visit: http://www.mysql.com/ For developer information, including the MySQL Reference Manual, visit: http://dev.mysql.com/ To buy MySQL Enterprise support, training, or other products, visit: https://shop.mysql.com/ List of all MySQL commands: Note that all text commands must be first on line and end with ';' ? (\?) Synonym for `help'. clear (\c) Clear the current input statement. connect (\r) Reconnect to the server. Optional arguments are db and host. delimiter (\d) Set statement delimiter. edit (\e) Edit command with $EDITOR. ego (\G) Send command to mysql server, display result vertically. exit (\q) Exit mysql. Same as quit. go (\g) Send command to mysql server. help (\h) Display this help. nopager (\n) Disable pager, print to stdout. notee (\t) Don't write into outfile. pager (\P) Set PAGER [to_pager]. Print the query results via PAGER. print (\p) Print current command. prompt (\R) Change your mysql prompt. quit (\q) Quit mysql. rehash (\#) Rebuild completion hash. source (\.) Execute an SQL script file. Takes a file name as an argument. status (\s) Get status information from the server. system (\!) Execute a system shell command. tee (\T) Set outfile [to_outfile]. Append everything into given outfile. use (\u) Use another database. Takes database name as argument. charset (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets. warnings (\W) Show warnings after every statement. nowarning (\w) Don't show warnings after every statement. For server side help, type 'help contents'**
3.4\Gmysql中在sql语句后面加\G表示将查询结果按列打印,默认情况下,mysql的查询结果是横向输出的,第一行是列头,后面是记录集,
3.5\c或者CTRL+c 这里表示的是取消的意思
mysql> asdfasdlkjlds \c
3.6mysql命令,source命令使用
在mysql中处理文件
如果这些文件包含sql语句,则称为“脚本文件”,“批处理文件”
使用SOURCE命令
mysql> source /root/world.sql
3.7 mysql数据库的关闭
方法一:
mysqladmin -uroot -p123456 shutdown
方法二:
service mysqld stop
方法三:
/etc/init.d/mysqld stop
第四种方法是利用系统进程管理命令关闭mysql
kill pid #这里的pid为数据库服务对应的进程号
killall mysqld #这里的mysqld是数据库对应的进程名字
pkill mysqld #这里的mysqld是数据库服务对应的进程名字
3.8my.cnf配置文件说明
影响到服务器进程的启动
影响到客户端程序
mysql程序主配置文件
3.9配置文件读取过程
/etc/my.cnf --> /etc/mysql/my.cnf --> $MYSQL_HOME/my.cnf --> defaults-extra-file=/tmp/clsn.txt --> ~/.my.cnf
相关文章推荐
- 管理系统中的mysql基本应用
- 基于express,MySQL,ejs实现的一个简单基本的网站后台管理应用
- MySQL基本管理和应用
- Mysql 基本管理命令
- MySQL之终端(Terminal)管理数据库、数据表、数据的基本操作
- Android——Preference详解之Preference系的基本应用和管理(二)
- MySQL 基本操作和用户管理
- 运维之mysql篇------1. 数据库服务概述 、 构建MySQL服务器 、 数据库基本管理 、 MySQL数据类型 、 表结构的调整
- 塑胶行业应用点――水口料的基本知识及相关管理
- MySQL之终端(Terminal)管理数据库、数据表、数据的基本操作
- 环境安装系列 - Linux下 MYSQL安装和基本管理
- mysql 基本管理
- phpmyadmin管理MySQL基本操作
- [非凡程序员]Mysql,sqlite的基本应用 sqlite在工程中的使用
- 2.3: mysql数据基本管理
- linux 下用户管理命令基本应用
- 构建LAMP平台及应用系统 部署phpMyAdmin系统(用网页的形式管理MySQL)
- MySQL应用管理常用命令
- MySQL之终端Terminal(dos界面)管理数据库、数据表、数据的基本操作
- mysql基本应用