zoukankan      html  css  js  c++  java
  • CentOS7 下启动、关闭、重启、查看MySQL服务

    1.启动命令

    [root@iZuf625ohgv150cwlh1yn4Z bin]# service mysqlid start
    Redirecting to /bin/systemctl start mysqlid.service
    

    2.关闭命令

    [root@iZuf625ohgv150cwlh1yn4Z bin]#  service mysqld stop
    Redirecting to /bin/systemctl stop  mysqld.service
    

    3.重启命令

    [root@iZuf625ohgv150cwlh1yn4Z bin]#   service mysqld restart
    Redirecting to /bin/systemctl restart  mysqld.service
    

    4.查看服务状态

    [root@iZuf625ohgv150cwlh1yn4Z sbin]# service mysqld status
    Redirecting to /bin/systemctl status mysqld.service
    ● mysqld.service - MySQL Server
       Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
       Active: active (running) since Sat 2021-04-10 14:25:15 CST; 10min ago
         Docs: man:mysqld(8)
               http://dev.mysql.com/doc/refman/en/using-systemd.html
      Process: 12683 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
      Process: 12666 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
     Main PID: 12686 (mysqld)
       CGroup: /system.slice/mysqld.service
               └─12686 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid
    
    Apr 10 14:25:14 iZuf625ohgv150cwlh1yn4Z systemd[1]: Starting MySQL Server...
    Apr 10 14:25:15 iZuf625ohgv150cwlh1yn4Z systemd[1]: Started MySQL Server.
    

    5.查看MySql系统配置

    [root@iZuf625ohgv150cwlh1yn4Z sbin]# cat /etc/my.cnf
    # For advice on how to change settings please see
    # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
    
    [mysqld]
    port=8306
    #
    # Remove leading # and set to the amount of RAM for the most important data
    # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
    # innodb_buffer_pool_size = 128M
    #
    # Remove leading # to turn on a very important data integrity option: logging
    # changes to the binary log between backups.
    # log_bin
    #
    # Remove leading # to set options mainly useful for reporting servers.
    # The server defaults are faster for transactions and fast SELECTs.
    # Adjust sizes as needed, experiment to find the optimal values.
    # join_buffer_size = 128M
    # sort_buffer_size = 2M
    # read_rnd_buffer_size = 2M
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    
    # Disabling symbolic-links is recommended to prevent assorted security risks
    symbolic-links=0
    
    log-error=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid
    
    #key_buffer_size指定用于索引的缓冲区大小,增加它可得到更好的索引处理性能。对于内存在4GB左右的服务器该参数可设置为256M或384M。注意:该参数值设置的过大反而会是服务器整体效率降低!
    key_buffer_size = 128M 
    

    参考链接:https://blog.csdn.net/xufengzhu/article/details/81110982

    这世上所有美好的东西,都需要踮起脚尖。
  • 相关阅读:
    多态_python的小窝_百度空间
    可直接下载空间客户端
    简明 Python 教程 / 面向对象的编程 / 类与对象的方法
    C++ 基础 woaidongmao C++博客 good 量产
    set has enumerate
    python invoke super parent method
    分享:常用汉字的unicode 编码
    数据库调整也可以遵循“开闭原则”
    Ninject超轻量级的依赖注入工具
    点某个链接进网站,会发这个链接的会员加积分,实现方法(有时间限制)
  • 原文地址:https://www.cnblogs.com/XMYG/p/14640736.html
Copyright © 2011-2022 走看看