mysql-5.1.68的啟動和停止以及相關協議
1,mysqld[@more@]
[root@oracle bin]# ./mysqladmin shutdown
[root@oracle bin]# ps -ef | grep mysql
root 14146 13810 0 07:02 pts/3 00:00:00 grep mysql
[root@oracle bin]# cd ../libexec/
[root@oracle libexec]# pwd
/u02/mysql5168/libexec
[root@oracle libexec]# ./mysqld --defaults-file=/u02/my.cnf --user=mysql
130224 7:03:40 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
130224 7:03:40 InnoDB: Initializing buffer pool, size = 8.0M
130224 7:03:40 InnoDB: Completed initialization of buffer pool
130224 7:03:40 InnoDB: Started; log sequence number 0 44233
130224 7:03:40 [Note] Event Scheduler: Loaded 0 events
130224 7:03:40 [Note] ./mysqld: ready for connections.
Version: '5.1.68bruce' socket: '/tmp/mysql.sock' port: 3306 Source distribution
2,mysqld_safe
Mysqld_safe read all options from [mysqld][server][mysqld_safe]
Mysqld_safe is shell script 可以呼叫mysqld,mysqld_safe set up error log,if mysqld_safe terminated abnormally,mysqld_safe restart it
[root@oracle bin]# ./mysqladmin shutdown
[root@oracle bin]# cd bin
-bash: cd: bin: No such file or directory
[root@oracle bin]# pwd
/u02/mysql5168/bin
[root@oracle bin]# ./mysqld_safe --defaults-file=/u02/my.cnf --user=mysql
130224 07:17:21 mysqld_safe Logging to '/u02/mysql5168/data/oracle.err'.
130224 07:17:21 mysqld_safe Starting mysqld daemon with databases from /u02/mysql5168/data
從後臺程式看,mysqld_safe是直接呼叫mysqld的,mysqld_safe就是mysqld的父程式.
[root@oracle ~]# ps -ef | grep mysql
root 14281 14161 0 07:17 pts/1 00:00:00 /bin/sh ./mysqld_safe --defaults-file=/u02/my.cnf --user=mysql
mysql 14393 14281 0 07:17 pts/1 00:00:00 /u02/mysql5168/libexec/mysqld --defaults-file=/u02/my.cnf --basedir=/u02/mysql5168 --datadir=/u02/mysql5168/data --user=mysql --log-error=/u02/mysql5168/data/oracle.err --pid-file=/u02/mysql5168/data/oracle.pid --socket=/tmp/mysql.sock --port=3306
root 14439 14406 0 07:17 pts/2 00:00:00 grep mysql
[root@oracle ~]# cd /u02/mysql5168/bin/
[root@oracle bin]# ./mysql
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1
Server version: 5.1.68bruce Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql>
設定為後臺啟動:
[root@oracle bin]# ./mysqladmin shutdown
[root@oracle bin]# ./mysqld_safe --defaults-file=/u02/my.cnf --user=mysql &
[1] 14617
[root@oracle bin]# 130224 07:22:34 mysqld_safe Logging to '/u02/mysql5168/data/oracle.err'.
130224 07:22:34 mysqld_safe Starting mysqld daemon with databases from /u02/mysql5168/data
3,mysql.server以服務啟動
$mysql_base/share/mysql/mysql.server & support-files/mysql.server
A shell script直接呼叫mysqld_safe
[root@oracle bin]# ./mysqladmin shutdown
130224 07:26:09 mysqld_safe mysqld from pid file /u02/mysql5168/data/oracle.pid ended
[1]+ Done ./mysqld_safe --defaults-file=/u02/my.cnf --user=mysql
[root@oracle bin]# cd ../share/mysql/
[root@oracle mysql]# pwd
/u02/mysql5168/share/mysql
[root@oracle mysql]# ./mysql.server --help
Usage: ./mysql.server {start|stop|restart|reload|force-reload|status} [ MySQL server options ]
[root@oracle mysql]# cp mysql.server /etc/rc.d/init.d/mysqld51
[root@oracle mysql]# chkconfig --add mysqld51
[root@oracle mysql]# chkconfig --list mysqld51
mysqld51 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@oracle mysql]# service mysqld51 start
Mysql的相關協議
Protocol type of connections supported OS
TCP/IP local,remote all
Unix socket file local only unix only
Named pipe local only windows only
Shared memory local only windows only
TCP/IP connections are supported by any mysql server unless the server is started with the –skip-networking option
Unix socket file connections are supportd by all unix servers
Named-pipe connectsions are supported only on windows and only if you use one of the servers that has –nt in its name(mysql-nt,mysql-max-nt),however,named pipes are disabled by default,to enable named-pipe connectsion,you must start the –nt server with the –enable-name-pipe option
Shared-memory connections are supported by all windows servers,but are disable by default. To enable shared-memory connections,you must start the server with the
–shared-mmeory option
常用客戶端工具:mysql ,mysqladmin,mysqlimport,mysqldump
- Mysqld is the mysql server
- Mysql read options from the [mysqld] and [server] groups
- 直接呼叫的話,error message會定位到終端,不會到日誌
[root@oracle bin]# ./mysqladmin shutdown
[root@oracle bin]# ps -ef | grep mysql
root 14146 13810 0 07:02 pts/3 00:00:00 grep mysql
[root@oracle bin]# cd ../libexec/
[root@oracle libexec]# pwd
/u02/mysql5168/libexec
[root@oracle libexec]# ./mysqld --defaults-file=/u02/my.cnf --user=mysql
130224 7:03:40 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
130224 7:03:40 InnoDB: Initializing buffer pool, size = 8.0M
130224 7:03:40 InnoDB: Completed initialization of buffer pool
130224 7:03:40 InnoDB: Started; log sequence number 0 44233
130224 7:03:40 [Note] Event Scheduler: Loaded 0 events
130224 7:03:40 [Note] ./mysqld: ready for connections.
Version: '5.1.68bruce' socket: '/tmp/mysql.sock' port: 3306 Source distribution
2,mysqld_safe
Mysqld_safe read all options from [mysqld][server][mysqld_safe]
Mysqld_safe is shell script 可以呼叫mysqld,mysqld_safe set up error log,if mysqld_safe terminated abnormally,mysqld_safe restart it
[root@oracle bin]# ./mysqladmin shutdown
[root@oracle bin]# cd bin
-bash: cd: bin: No such file or directory
[root@oracle bin]# pwd
/u02/mysql5168/bin
[root@oracle bin]# ./mysqld_safe --defaults-file=/u02/my.cnf --user=mysql
130224 07:17:21 mysqld_safe Logging to '/u02/mysql5168/data/oracle.err'.
130224 07:17:21 mysqld_safe Starting mysqld daemon with databases from /u02/mysql5168/data
從後臺程式看,mysqld_safe是直接呼叫mysqld的,mysqld_safe就是mysqld的父程式.
[root@oracle ~]# ps -ef | grep mysql
root 14281 14161 0 07:17 pts/1 00:00:00 /bin/sh ./mysqld_safe --defaults-file=/u02/my.cnf --user=mysql
mysql 14393 14281 0 07:17 pts/1 00:00:00 /u02/mysql5168/libexec/mysqld --defaults-file=/u02/my.cnf --basedir=/u02/mysql5168 --datadir=/u02/mysql5168/data --user=mysql --log-error=/u02/mysql5168/data/oracle.err --pid-file=/u02/mysql5168/data/oracle.pid --socket=/tmp/mysql.sock --port=3306
root 14439 14406 0 07:17 pts/2 00:00:00 grep mysql
[root@oracle ~]# cd /u02/mysql5168/bin/
[root@oracle bin]# ./mysql
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1
Server version: 5.1.68bruce Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql>
設定為後臺啟動:
[root@oracle bin]# ./mysqladmin shutdown
[root@oracle bin]# ./mysqld_safe --defaults-file=/u02/my.cnf --user=mysql &
[1] 14617
[root@oracle bin]# 130224 07:22:34 mysqld_safe Logging to '/u02/mysql5168/data/oracle.err'.
130224 07:22:34 mysqld_safe Starting mysqld daemon with databases from /u02/mysql5168/data
3,mysql.server以服務啟動
$mysql_base/share/mysql/mysql.server & support-files/mysql.server
A shell script直接呼叫mysqld_safe
[root@oracle bin]# ./mysqladmin shutdown
130224 07:26:09 mysqld_safe mysqld from pid file /u02/mysql5168/data/oracle.pid ended
[1]+ Done ./mysqld_safe --defaults-file=/u02/my.cnf --user=mysql
[root@oracle bin]# cd ../share/mysql/
[root@oracle mysql]# pwd
/u02/mysql5168/share/mysql
[root@oracle mysql]# ./mysql.server --help
Usage: ./mysql.server {start|stop|restart|reload|force-reload|status} [ MySQL server options ]
[root@oracle mysql]# cp mysql.server /etc/rc.d/init.d/mysqld51
[root@oracle mysql]# chkconfig --add mysqld51
[root@oracle mysql]# chkconfig --list mysqld51
mysqld51 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@oracle mysql]# service mysqld51 start
Mysql的相關協議
Protocol type of connections supported OS
TCP/IP local,remote all
Unix socket file local only unix only
Named pipe local only windows only
Shared memory local only windows only
TCP/IP connections are supported by any mysql server unless the server is started with the –skip-networking option
Unix socket file connections are supportd by all unix servers
Named-pipe connectsions are supported only on windows and only if you use one of the servers that has –nt in its name(mysql-nt,mysql-max-nt),however,named pipes are disabled by default,to enable named-pipe connectsion,you must start the –nt server with the –enable-name-pipe option
Shared-memory connections are supported by all windows servers,but are disable by default. To enable shared-memory connections,you must start the server with the
–shared-mmeory option
常用客戶端工具:mysql ,mysqladmin,mysqlimport,mysqldump
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-1060239/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- IOT相關協議協議
- HTTP協議相關文件HTTP協議
- 4.1.4 關於啟動和停止Oracle RestartOracleREST
- RTMP協議相關知識協議
- TCP/IP 協議相關的問題TCP協議
- Redis 原始碼安裝以及啟動、停止Redis原始碼
- 應用層相關協議分析協議
- 啟動和停止任務
- 10分鐘理解TCP/IP各個協議以及協議之間的關係TCP協議
- nginx啟動命令和停止命令。Nginx
- 啟動和停止資料庫.資料庫
- 淺談WebSocket協議、WS協議和WSS協議原理及關係Web協議
- 關於SSL協議未開啟協議
- Web伺服器的工作原理及其相關協議Web伺服器協議
- redis的安裝和啟動和檢測和停止Redis
- MySQL學習筆記之啟動停止與登入,顯示相關資訊MySql筆記
- Android 啟動和停止服務Android
- ORACLE EXPDP IMPDP 中停止和啟動Oracle
- WebRTC:資料傳輸相關協議簡介Web協議
- LTE相關協議2——下行峰值速率計算協議
- Web伺服器的工作原理及其相關協議-VeCloudWeb伺服器協議Cloud
- iOS10 再談 CAAnimationDelegate 相關協議的適配iOS協議
- oracle 啟動停止Oracle
- ORACLE EXPDP IMPDP 的停止和啟動及監控Oracle
- 關於SSL協議未開啟的解決方案協議
- Activity啟動相關屬性
- TCP協議與UDP協議以及兩者之間的區別TCP協議UDP
- Oracle的AMM和ASMM以及相關引數探究OracleASM
- 四、Docker的啟動與停止Docker
- nginx啟動,停止命令Nginx
- PostgreSQL:啟動與停止SQL
- 網路程式設計協議(TCP和UDP協議,黏包問題)以及socketserver模組程式設計協議TCPUDPServer
- linux停止和檢視啟動服務的命令Linux
- 關於協議首部校驗和的問題協議
- [面試∙網路] TCP/IP(三):IP協議相關技術面試TCP協議
- Flutter學習(六) 動畫以及動效相關Flutter動畫
- systemctl 命令在 Linux 中啟動、停止和重新啟動服務Linux
- Gossip協議和Grpc協議的區別Go協議RPC