標籤:資料庫-mysql
情境還原:
初始化
#/usr/local/webserver/mysql/bin/mysql_install_db --user=mysql --basedir=/usr/local/webserver/mysql/ --datadir=/home/mysqldata
Installing MySQL system tables...
150205 11:48:00 [Note] Flashcache bypass: disabled
150205 11:48:00 [Note] Flashcache setup error is : ioctl failed
OK
Filling help tables...
150205 11:48:00 [Note] Flashcache bypass: disabled
150205 11:48:00 [Note] Flashcache setup error is : ioctl failed
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/local/webserver/mysql//bin/mysqladmin -u root password ‘new-password‘
/usr/local/webserver/mysql//bin/mysqladmin -u root -h kooxoo17.ktep3.kuxun.cn password ‘new-password‘
Alternatively you can run:
/usr/local/webserver/mysql//bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr/local/webserver/mysql/ ; /usr/local/webserver/mysql//bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/local/webserver/mysql//mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/local/webserver/mysql//scripts/mysqlbug script!
Percona recommends that all production deployments be protected with a support
contract (http://www.percona.com/mysql-suppport/) to ensure the highest uptime,
be eligible for hot fixes, and boost your team‘s productivity.
啟動
#/usr/local/webserver/mysql/bin/mysqld_safe --user=mysql --defaults-file=/etc/my.cnf --basedir=/usr/local/webserver/mysql/ --datadir=/home/mysqldata &
[1] 29154
[[email protected] wuxy]# 150205 11:49:18 mysqld_safe Logging to ‘/var/log/mysqld.log‘.
150205 11:49:18 mysqld_safe Starting mysqld daemon with databases from /home/mysqldata
150205 11:49:18 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
查看日誌/var/log/mysqld.log
150205 11:53:19 mysqld_safe Starting mysqld daemon with databases from /home/mysqldata
150205 11:53:19 [Note] Flashcache bypass: disabled
150205 11:53:19 [Note] Flashcache setup error is : ioctl failed
150205 11:53:19 [Note] Plugin ‘FEDERATED‘ is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Compressed tables use zlib 1.2.3
150205 11:53:19 InnoDB: Initializing buffer pool, size = 128.0M
150205 11:53:19 InnoDB: Completed initialization of buffer pool
150205 11:53:19 InnoDB: highest supported file format is Barracuda.
150205 11:53:19 Percona XtraDB (http://www.percona.com) 1.0.15-12.5 started; log sequence number 45356
150205 11:53:19 [ERROR] /usr/local/webserver/mysql/libexec/mysqld: unknown variable ‘defaults-file=/etc/my.cnf‘
150205 11:53:19 [ERROR] Aborting
150205 11:53:19 InnoDB: Starting shutdown...
150205 11:53:20 InnoDB: Shutdown completed; log sequence number 45356
150205 11:53:20 [Note] /usr/local/webserver/mysql/libexec/mysqld: Shutdown complete
150205 11:53:20 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
原因是:
要使用指定的my.cnf,而不用預設的/etc/my.cnf檔案,可以在啟動時,在mysqld_safe後加上參數--default-file=/usr/local/server/mysql2/etc/my.cnf,但是要注意的是,主參數必須緊接著mysqld_safe後面,如果做第二個或者第二個以後的參數加入時,則會出現如下類似錯誤錯誤:
/usr/local/server/mysql/libexec/mysqld: unknown variable ‘defaults-file=/usr/local/server/mysql2/etc/my.cnf‘ 且服務無法啟動!
這是mysql的一個bug!
mysql啟動報錯解決-2