mysql的啟動

來源:互聯網
上載者:User

標籤:style   blog   color   os   io   for   art   cti   

1。直接用mysqld手工啟動

[[email protected] bin]# ./mysqld --defaults-file=../my.cnf 140328 10:04:37 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!140328 10:04:37 [ERROR] Aborting140328 10:04:37 [Note] ./mysqld: Shutdown complete[[email protected] bin]# ./mysqld --defaults-file=../my.cnf --user=mysql140328 10:04:44 InnoDB: The InnoDB memory heap is disabled140328 10:04:44 InnoDB: Mutexes and rw_locks use InnoDB‘s own implementation140328 10:04:44 InnoDB: Compressed tables use zlib 1.2.3140328 10:04:44 InnoDB: Using Linux native AIO140328 10:04:44 InnoDB: Initializing buffer pool, size = 128.0M140328 10:04:44 InnoDB: Completed initialization of buffer pool140328 10:04:44 InnoDB: highest supported file format is Barracuda.InnoDB: The log sequence number in ibdata files does not matchInnoDB: the log sequence number in the ib_logfiles!140328 10:04:44  InnoDB: Database was not shut down normally!InnoDB: Starting crash recovery.InnoDB: Reading tablespace information from the .ibd files...InnoDB: Restoring possible half-written data pages from the doublewriteInnoDB: buffer...140328 10:04:44  InnoDB: Waiting for the background threads to start140328 10:04:45 InnoDB: 5.5.37 started; log sequence number 1595675140328 10:04:45 [Note] Server hostname (bind-address): ‘0.0.0.0‘; port: 3306140328 10:04:45 [Note]   - ‘0.0.0.0‘ resolves to ‘0.0.0.0‘;140328 10:04:45 [Note] Server socket created on IP: ‘0.0.0.0‘.140328 10:04:45 [Note] Event Scheduler: Loaded 0 events140328 10:04:45 [Note] ./mysqld: ready for connections.Version: ‘5.5.37‘  socket: ‘/tmp/mysql.sock‘  port: 3306  Source distribution[[email protected] ~]# ps -ef | grep mysqlmysql     7641  7547  1 10:04 pts/1    00:00:00 ./mysqld --defaults-file=../my.cnf --user=mysqlroot      7697  7661  0 10:05 pts/2    00:00:00 grep mysql[[email protected] ~]# 

 2.安全啟動

[[email protected] bin]# ./mysqld_safe --defaults-file=../my.cnf --user=mysql &[1] 7758[[email protected] bin]# 140328 10:13:16 mysqld_safe Logging to ‘/usr/local/mysql/data/ora11g.err‘.140328 10:13:16 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data[[email protected] bin]# ps -ef | grep mysqlroot      7758  7661  0 10:13 pts/2    00:00:00 /bin/sh ./mysqld_safe --defaults-file=../my.cnf --user=mysqlmysql     8024  7758  0 10:13 pts/2    00:00:00 /usr/local/mysql/bin/mysqld --defaults-file=../my.cnf --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/ora11g.err --pid-file=/usr/local/mysql/data/ora11g.pid --socket=/tmp/mysql.sock --port=3306root      8044  7661  0 10:13 pts/2    00:00:00 grep mysql[[email protected] bin]# 

 3.用服務的方式啟動

[[email protected] support-files]# [[email protected] support-files]# ./mysql.server startStarting MySQL                                             [  OK  ][[email protected] support-files]# ps -ef | grep mysql root      8433     1  3 10:24 pts/2    00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/ora11g.pidmysql     8705  8433 12 10:24 pts/2    00:00:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/ora11g.err --pid-file=/usr/local/mysql/data/ora11g.pid --socket=/tmp/mysql.sock --port=3306root      8723  7661  0 10:24 pts/2    00:00:00 grep mysql[[email protected] support-files]# 

把mysql.server cp到 /etc/rc.d/init.d/mysql,再chkconfig --add mysql就ok了

[[email protected] support-files]# cp mysql.server  /etc/rc.d/init.d/mysql [[email protected] support-files]# chkconfig --add mysql[[email protected] support-files]# chkconfig --list | grep mysqlmysql           0:off   1:off   2:on    3:on    4:on    5:on    6:off[[email protected] support-files]# service mysqld stopmysqld: unrecognized service[[email protected] support-files]# service mysql stop Shutting down MySQL.                                       [  OK  ][[email protected] support-files]# service mysql startStarting MySQL..                                           [  OK  ][[email protected] support-files]# ps -ef | grep mysql                     root      8808     1  1 10:28 pts/2    00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/ora11g.pidmysql     9073  8808  2 10:28 pts/2    00:00:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/ora11g.err --pid-file=/usr/local/mysql/data/ora11g.pid --socket=/tmp/mysql.sock --port=3306root      9100  7661  0 10:28 pts/2    00:00:00 grep mysql[[email protected] support-files]# 

 

查看mysql的啟動時的參數:

[[email protected] bin]# ./mysqld --help --verbose | less

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.