![](https://img.51dongshi.com/20250105/wz/18528784552.jpg)
?接下來就是安裝了分別依次執行:[root@iZ25in7iu0fZ?rpm]#?rpm?-ivh?MysqL-server-5.6.15-1.el6.x86_64.rpmPreparing...?###########################################?[100%]1:MysqL-server?###########################################?[100%]2015-03-06?08:16:03?0?[Warning]?TIMESTAMP?with?implicit?DEFAULT?value?is?deprecated.?Please?use?--explicit_defaults_fZ喎?"pleted;?log?sequence?number?16259772015-03-06?08:16:08?0?[Warning]?TIMESTAMP?with?implicit?DEFAULT?value?is?deprecated.?Please?use?--explicit_defaults_for_timestamp?server?option?(see?documentation?for?more?details).2015-03-06?08:16:08?28652?[Note]?InnoDB:?The?InnoDB?memory?heap?is?disabled2015-03-06?08:16:08?28652?[Note]?InnoDB:?Mutexes?and?rw_locks?use?GCC?atomic?builtins2015-03-06?08:16:08?28652?[Note]?InnoDB:?Compressed?tables?use?zlib?1.2.32015-03-06?08:16:08?28652?[Note]?InnoDB:?Using?Linux?native?AIO2015-03-06?08:16:08?28652?[Note]?InnoDB:?Using?cpu?crc32?instructions2015-03-06?08:16:08?28652?[Note]?InnoDB:?Initializing?buffer?pool,?size?=?128.0M2015-03-06?08:16:08?28652?[Note]?InnoDB:?Completed?initialization?of?buffer?pool2015-03-06?08:16:08?28652?[Note]?InnoDB:?Highest?supported?file?format?is?Barracuda.2015-03-06?08:16:08?28652?[Note]?InnoDB:?128?rollback?segment(s)?are?active.2015-03-06?08:16:08?28652?[Note]?InnoDB:?Waiting?for?purge?to?start2015-03-06?08:16:08?28652?[Note]?InnoDB:?5.6.15?started;?log?sequence?number?16259772015-03-06?08:16:08?28652?[Note]?binlog?end2015-03-06?08:16:08?28652?[Note]?InnoDB:?FTS?optimize?thread?exiting.2015-03-06?08:16:08?28652?[Note]?InnoDB:?Starting?shutdown...2015-03-06?08:16:10?28652?[Note]?InnoDB:?Shutdown?completed;?log?sequence?number?1625987[root@iZ25in7iu0fZ?rpm]#?rpm?-ivh?MysqL-devel-5.6.15-1.el6.x86_64.rpmPreparing...?###########################################?[100%]1:MysqL-devel?###########################################?[100%][root@iZ25in7iu0fZ?rpm]#?rpm?-ivh?MysqL-client-5.6.15-1.el6.x86_64.rpmPreparing...?###########################################?[100%]1:MysqL-client?###########################################?[100%]修改配置文件位置。[root@iZ25in7iu0fZ?rpm]#?cp?/usr/MysqL/my-default.cnf?/etc/my.cnf初始化MysqL及設置密碼cp?/usr/MysqL/my-default.cnf?/etc/my.cnf/usr/bin/MysqL_install_dbcat?/root/.MysqL_secret?記錄最后的密碼MysqL?-p?---輸入記錄的密碼,即可登錄MysqL。set?password?for?'root'@'localhost'?=password('新密碼');flush?privileges;exit設置自啟動chkconfig?MysqL?onMysqL的默認安裝位置接下來就是安裝了分別依次執行:[root@iZ25in7iu0fZ?rpm]#?rpm?-ivh?MysqL-server-5.6.15-1.el6.x86_64.rpmPreparing...?###########################################?[100%]1:MysqL-server?###########################################?[100%]2015-03-06?08:16:03?0?[Warning]?TIMESTAMP?with?implicit?DEFAULT?value?is?deprecated.?Please?use?--explicit_defaults_fZ喎?"pleted;?log?sequence?number?16259772015-03-06?08:16:08?0?[Warning]?TIMESTAMP?with?implicit?DEFAULT?value?is?deprecated.?Please?use?--explicit_defaults_for_timestamp?server?option?(see?documentation?for?more?details).2015-03-06?08:16:08?28652?[Note]?InnoDB:?The?InnoDB?memory?heap?is?disabled2015-03-06?08:16:08?28652?[Note]?InnoDB:?Mutexes?and?rw_locks?use?GCC?atomic?builtins2015-03-06?08:16:08?28652?[Note]?InnoDB:?Compressed?tables?use?zlib?1.2.32015-03-06?08:16:08?28652?[Note]?InnoDB:?Using?Linux?native?AIO2015-03-06?08:16:08?28652?[Note]?InnoDB:?Using?cpu?crc32?instructions2015-03-06?08:16:08?28652?[Note]?InnoDB:?Initializing?buffer?pool,?size?=?128.0M2015-03-06?08:16:08?28652?[Note]?InnoDB:?Completed?initialization?of?buffer?pool2015-03-06?08:16:08?28652?[Note]?InnoDB:?Highest?supported?file?format?is?Barracuda.2015-03-06?08:16:08?28652?[Note]?InnoDB:?128?rollback?segment(s)?are?active.2015-03-06?08:16:08?28652?[Note]?InnoDB:?Waiting?for?purge?to?start2015-03-06?08:16:08?28652?[Note]?InnoDB:?5.6.15?started;?log?sequence?number?16259772015-03-06?08:16:08?28652?[Note]?binlog?end2015-03-06?08:16:08?28652?[Note]?InnoDB:?FTS?optimize?thread?exiting.2015-03-06?08:16:08?28652?[Note]?InnoDB:?Starting?shutdown...2015-03-06?08:16:10?28652?[Note]?InnoDB:?Shutdown?completed;?log?sequence?number?1625987[root@iZ25in7iu0fZ?rpm]#?rpm?-ivh?MysqL-devel-5.6.15-1.el6.x86_64.rpmPreparing...?###########################################?[100%]1:MysqL-devel?###########################################?[100%][root@iZ25in7iu0fZ?rpm]#?rpm?-ivh?MysqL-client-5.6.15-1.el6.x86_64.rpmPreparing...?###########################################?[100%]1:MysqL-client?###########################################?[100%]修改配置文件位置。[root@iZ25in7iu0fZ?rpm]#?cp?/usr/MysqL/my-default.cnf?/etc/my.cnf初始化MysqL及設置密碼cp?/usr/MysqL/my-default.cnf?/etc/my.cnf/usr/bin/MysqL_install_dbcat?/root/.MysqL_secret?記錄最后的密碼MysqL?-p?---輸入記錄的密碼,即可登錄MysqL。set?password?for?'root'@'localhost'?=password('新密碼');flush?privileges;exit設置自啟動chkconfig?MysqL?onMysqL的默認安裝位置??1arb/MysqL/?#數據庫目錄2/usr/MysqL?#配置文件目錄3/usr/bin?#相關命令目錄4/etc/init.d/MysqL?#啟動腳本?修改字符集和數據存放目錄原來配置文件:?更改之后為:?#Foradviceonhowtochangesettingspleasesee#/doc/refman/5.6/en/server-configuration-defaults.html#***DONOTEDITTHISFILE.It"satemplatewhichwillbecopiedtothe#***defaultlocationduringinstall,andwillbereplacedifyou#***upgradetoanewerversionofMysqL.??[client]port=3306default-character-set=utf8????[MysqLd]??#Removeleading#andsettotheamountofRAMforthemostimportantdata#cacheinMysqL.Startat70%oftotalRAMfordedicatedserver,else10%.#innodb_buffer_pool_size=128M??#Removeleading#toturnonaveryimportantdataintegrityoption:logging#changestothebinarylogbetweenbackups.#log_bin??#Thesearecommonlyset,removethe#andsetasrequired.#basedir=.....datadir=/mnt/data/MysqLport=3306#server_id=.....#socket=.....??lower_case_table_names=1??max_connections=1000??collation_server=utf8_general_cicharacter_set_server=utf8??#default-character-set=utf8#init_connect='SETNAMESutf8'????#Removeleading#tosetoptionsmainlyusefulforreportingservers.#TheserverdefaultsarefasterfortransactionsandfastSELECTs.#Adjustsizesasneeded,experimenttofindtheoptimalvalues.#join_buffer_size=128M#sort_buffer_size=2M#read_rnd_buffer_size=2M??sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES??[MysqL]default-character-set=utf8?注意標紅的。??然后就是修改數據庫的數據目錄:vi/etc/init.d/MysqL重啟數據庫:??serviceMysqLrestart大功告成。