標籤:style blog http color io strong 檔案 for
1、首先下載:http://cdn1.mydown.yesky.com/soft/201403/mysql-5.6.4-m7.tar.gz
2、解壓,進入目錄,執行cmake ./(如果沒有cmake,那麼安裝 sudo yum install cmake),可能出錯:
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.
那麼安裝:sudo yum install gcc-c++ -y
如果還有錯誤:
CMake Error at cmake/readline.cmake:82 (MESSAGE):Curses library not found. Please install appropriate package,remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
安裝:yum install ncurses-devel -y
3、make & sudo make install
4、配置mysql
4.1 進入script目錄
4.2 sudo chmod +x mysql_install_db
4.3 sudo ./mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/ --user=mysql
To start mysqld at boot time you have to copysupport-files/mysql.server to the right place for your systemPLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !To do so, start the server, then issue the following commands:/usr/local/mysql/bin/mysqladmin -u root password ‘new-password‘/usr/local/mysql/bin/mysqladmin -u root -h l-data2.tkt.cn6 password ‘new-password‘Alternatively you can run:/usr/local/mysql/bin/mysql_secure_installationwhich will also give you the option of removing the testdatabases and anonymous user created by default. This isstrongly recommended for production servers.See the manual for more instructions.You can start the MySQL daemon with:cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &You can test the MySQL daemon with mysql-test-run.plcd /usr/local/mysql/mysql-test ; perl mysql-test-run.plPlease report any problems with the /usr/local/mysql/scripts/mysqlbug script!
仔細看上面的提示。
4.4 添加設定檔
[[email protected] /tmp/mysql-5.6.4-m7/scripts]$ cd /usr/local/mysql/support-files/[[email protected]-data2.tkt.cn6 /usr/local/mysql/support-files]$ sudo cp my-medium.cnf /etc/my.cnf[[email protected]-data2.tkt.cn6 /usr/local/mysql/support-files]$ sudo cp mysql.server /etc/init.d/mysqld
5、啟動服務:
[[email protected] /usr/local/mysql/support-files]$ sudo service mysqld startStarting MySQL. [ OK ]
6、進入mysql
參考:
http://blog.sina.com.cn/s/blog_7bd720d4010181xg.html
http://www.jb51.net/article/42548.htm