国产精品久久久久aaaa,色综合久久成人综合网,日本少妇被爽到高潮无码,特黄熟妇丰满人妻无码

學習啦>學習電腦>操作系統>Linux教程>

linux中mysql啟動服務命令

時間: 佳洲1085 分享

  Linux下使用相關命令可以直接啟動mysql服務,下面由學習啦小編為大家整理了linux下mysql啟動服務命令的相關知識,希望對大家有幫助!

  linux的mysql啟動服務命令

  linux的mysql啟動服務命令1:使用mysqld啟動、關閉MySQL服務

  mysqld是MySQL的守護進程,我們可以用mysqld來啟動、關閉MySQL服務,關于mysqld, MySQL 5.6官方介紹資料如下所示:

  mysqld, also known as MySQL Server, is the main program that does most of the work in a MySQL installation. MySQL Server manages access to the MySQL data directory that contains databases and tables. The data directory is also the default location for other information such as log files and status files.

  When MySQL server starts, it listens for network connections from client programs and manages access to databases on behalf of those clients.

  The mysqld program has many options that can be specified at startup. For a complete list of options, run this command:

  shell> mysqld --verbose --help

  MySQL Server also has a set of system variables that affect its operation as it runs. System variables can be set at server startup, and many of them can be changed at runtime to effect dynamic server reconfiguration. MySQL Server also has a set of status variables that provide information about its operation. You can monitor these status variables to access runtime performance characteristics.

  如果MySQL是rpm方式安裝的話,mysqld位于/usr/sbin下,如果MySQL是二進制安裝的話,mysqld則位于bin目錄下面。

  [root@localhost ~]# whereis mysqld

  mysqld: /usr/sbin/mysqld /usr/share/man/man8/mysqld.8.gz

  [root@localhost ~]# /usr/sbin/mysqld stop

  2016-06-27 14:52:54 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

  2016-06-27 14:52:54 9315 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

  2016-06-27 14:52:54 9315 [ERROR] Aborting

  2016-06-27 14:52:54 9315 [Note] Binlog end

  2016-06-27 14:52:54 9315 [Note] /usr/sbin/mysqld: Shutdown complete

  [root@localhost ~]# /usr/sbin/mysqld start

  2016-06-27 14:52:59 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

  2016-06-27 14:52:59 9316 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

  2016-06-27 14:52:59 9316 [ERROR] Aborting

  2016-06-27 14:52:59 9316 [Note] Binlog end

  2016-06-27 14:52:59 9316 [Note] /usr/sbin/mysqld: Shutdown complete

  linux的mysql啟動服務命令2:使用mysqld_safe啟動、關閉MySQL服務

  很多時候,人們會糾結mysqld與mysqld_safe的區別. 其實mysqld_safe是一個腳本,一個非常安全的啟動、關閉MySQL服務的腳本。它實際上也是調用mysqld來啟動、關閉MySQL服務。關于mysqld_safe,可以參考官方文檔mysqld_safe — MySQL Server Startup Script

  linux的mysql啟動服務命令3:使用mysql.server啟動、關閉MySQL服務

  [root@localhost mysql]# ./mysql.server stop

  Shutting down MySQL..[ OK ]

  [root@localhost mysql]# ./mysql.server start

  Starting MySQL..[ OK ]

  [root@localhost mysql]#

  mysql.server其實也是一個腳本,它通過調用msqld_safe來啟動、關閉MySQL服務。部分腳本腳本如下

  [root@localhost mysql]# more mysql.server

  #!/bin/sh

  # Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB

  # This file is public domain and comes with NO WARRANTY of any kind

  # MySQL daemon start/stop script.

  # Usually this is put in /etc/init.d (at least on machines SYSV R4 based

  # systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql.

  # When this is done the mysql server will be started when the machine is

  # started and shut down when the systems goes down.

  # Comments to support chkconfig on RedHat Linux

  # chkconfig: 2345 64 36

  # description: A very fast and reliable SQL database engine.

  # Comments to support LSB init script conventions

  ### BEGIN INIT INFO

  # Provides: mysql

  # Required-Start: $local_fs $network $remote_fs

  # Should-Start: ypbind nscd ldap ntpd xntpd

  # Required-Stop: $local_fs $network $remote_fs

  linux的mysql啟動服務命令4:使用mysqld_multi啟動、關閉MySQL服務

  當服務器上運行了多個MySQL實例時,mysqld_multi是一個非常棒的管理MySQL服務器的工具。當然在使用前,你必須提前做配置

  [root@localhost mysql]# /usr/bin/mysqld_multi stop 1

  [root@localhost mysql]# /usr/bin/mysqld_multi start 1

  mysqld_multi is designed to manage several mysqld processes that listen for connections on different Unix socket files and TCP/IP ports. It can start or stop servers, or report their current status.

  mysqld_multi searches for groups named [mysqldN] in my.cnf (or in the file named by the --defaults-file option). N can be any positive integer. This number is referred to in the following discussion as the option group number, or GNR. Group numbers distinguish option groups from one another and are used as arguments tomysqld_multi to specify which servers you want to start, stop, or obtain a status report for. Options listed in these groups are the same that you would use in the[mysqld] group used for starting mysqld. (See, for example, Section 2.10.5, “Starting and Stopping MySQL Automatically”.) However, when using multiple servers, it is necessary that each one use its own value for options such as the Unix socket file and TCP/IP port number. For more information on which options must be unique per server in a multiple-server environment, see Section 5.6, “Running Multiple MySQL Instances on One Machine”.

  linux的mysql啟動服務命令5:使用service 啟動、關閉MySQL服務

  service mysql start

  service mysql stop

  service mysql restart

  其實如果你對service比較熟悉的話,就會知道運行上面命令,其實是service命令去找/etc/init.d下的相關的mysql腳本去執行啟動、關閉動作。

  [root@DB-Server init.d]# ls my*

  mysql mysql.server

  [root@DB-Server init.d]#

  linux的mysql啟動服務命令6: 使用/etc/init.d/mysql啟動、關閉MySQL服務。

  如果你非常了解方法5,那么就多了這么一個啟動數據庫的方式。其實/etc/init.d/mysql也是一個腳本,它調用mysqld_safe腳本來啟動MySQL服務。如下所示,你會看到相關代碼

  [root@DB-Server bin]# /etc/init.d/mysql start

  Starting MySQL....[ OK ]

  [root@DB-Server bin]# /etc/init.d/mysql stop

  Shutting down MySQL..[ OK ]

  [root@DB-Server bin]#

  6:使用mysqladmin關閉數據庫

  mysqladmin是一個執行管理操作的客戶程序,這個命令可以使用安全模式關閉數據庫,但是不能啟動數據庫。當然它可以停止和啟動MySQL replication on a slave server

  [root@DB-Server bin]# /usr/bin/mysqladmin -u root -p shutdown

  Enter password:

linux中mysql啟動服務命令

Linux下使用相關命令可以直接啟動mysql服務,下面由學習啦小編為大家整理了linux下mysql啟動服務命令的相關知識,希望對大家有幫助! linux的mysql啟動服務命令 linux的mysql啟動服務命令1:使用mysqld啟動、關閉MySQL服務 mysqld是MySQL
推薦度:
點擊下載文檔文檔為doc格式
3629919 主站蜘蛛池模板: 万荣县| 逊克县| 田林县| 九龙城区| 宾阳县| 黄浦区| 和田市| 宜黄县| 安岳县| 奈曼旗| 成武县| 丁青县| 马山县| 仙居县| 宣武区| 那坡县| 通许县| 宁海县| 庆城县| 大石桥市| 建宁县| 准格尔旗| 铜梁县| 龙川县| 平顺县| 丽江市| 通山县| 琼结县| 泽库县| 金门县| 隆昌县| 察隅县| 盐亭县| 仲巴县| 松桃| 从江县| 太白县| 永川市| 海盐县| 东光县| 周至县|