设为首页 收藏本站
查看: 1193|回复: 0

[经验分享] MYSQL企业级应用(三)基本管理

[复制链接]

尚未签到

发表于 2018-10-6 13:49:59 | 显示全部楼层 |阅读模式
  3.1数据库连接管理
  登录数据库系统
  在命令行中登录mysql数据库管理系统,其中“-h”参数指连接的主机名,因为此处是连接本机,所以后面的内容为localhost;“-u”参数表示用户名,此处的用户名为root:“-p”参数指用户密码。按下回车键显示输入密码提示
  mysql -h localhost -u root -p
  3.2数据库的启动流程图介绍
DSC0000.jpg

  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



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-613981-1-1.html 上篇帖子: mysql单表多timestamp报错#1293 - Incorrect table definit 下篇帖子: 3分钟,YUM升级MYSQL,5.1到5.6
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表