亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Centos5.5中安裝Mysql5.5過程分享

 更新時間:2015年01月31日 13:05:07   投稿:junjie  
這篇文章主要介紹了Centos5.5中安裝Mysql5.5過程分享,本文使用編譯方法安裝MySQL,并給出了一些可能遇到的錯誤和解決方法,需要的朋友可以參考下

這幾天在centos下裝mysql,這里記錄一下安裝的過程,方便以后查閱

Mysql5.5.37安裝需要cmake,5.6版本開始都需要cmake來編譯,5.5以后的版本應該也要裝這個。

安裝cmake

復制代碼 代碼如下:

[root@local ~]# wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz
[root@local ~]# tar xvf cmake-2.8.12.2.tar.gz
[root@local ~]# cd cmake-2.8.12.2
[root@local cmake-2.8.12.2]#./bootstrap
[root@local cmake-2.8.12.2]# make
[root@local cmake-2.8.12.2]# make install

安裝mysql

復制代碼 代碼如下:

[root@local ~]# wget http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.37.tar.gz
[root@local ~]# tar xvf mysql-5.5.37.tar.gz
[root@local ~]# cd mysql-5.5.37
[root@local mysql-5.5.37]# cmake ./

可能還會報這個錯,沒有就跳過

復制代碼 代碼如下:

CMake Error at cmake/readline.cmake:83(MESSAGE):
Curses library not found.  Pleaseinstall appropriate package,
remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name islibncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
 cmake/readline.cmake:127 (FIND_CURSES)
 cmake/readline.cmake:217 (MYSQL_USE_BUNDLED_LIBEDIT)
 CMakeLists.txt:355 (MYSQL_CHECK_READLINE
-- Configuring incomplete, errors occurred!
See also "/root/my/mysql-5.5.37/CMakeFiles/CMakeOutput.log".
See also"/root/my/mysql-5.5.37/CMakeFiles/CMakeError.log".

說明centos系統(tǒng)沒有ncurses-devel

復制代碼 代碼如下:

[root@local ~]# wget http://invisible-island.net/datafiles/release/ncurses.tar.gz
[root@local ~]# cd ncurses-5.9
[root@local ncurses-5.9]#./configure
[root@local ncurses-5.9]# make
[root@local ncurses-5.9]# make install

再刪除剛才編譯生成的 CMakeCache.txt 文件,否則無法進行下一步

復制代碼 代碼如下:

[root@local mysql-5.5.37]# rm -f CMakeCache.txt

繼續(xù)編譯mysql

復制代碼 代碼如下:

[root@local ~]# cmake ./
[root@local ~]# make
[root@local ~]# make install

這樣,mysql默認將成功安裝到/usr/local/mysql

創(chuàng)建mysql用戶組

復制代碼 代碼如下:

[root@local ~]# groupadd mysql
[root@local ~]# useradd –r –g mysql mysql
[root@local ~]# chown –R mysql.mysql /usr/local/mysql

啟動mysql

復制代碼 代碼如下:

[root@local ~]# /usr/local/mysql/bin/mysqld_safe --user=mysql 

這里可能會發(fā)生錯誤,沒有就跳過:

復制代碼 代碼如下:

FATAL ERROR: Could not find./bin/my_print_defaults
If you compiled from source, you need torun 'make install' to
copy the software into the correct locationready for operation.
If you are using a binary release, you musteither be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.

解決方法:

復制代碼 代碼如下:

[root@local ~]# /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

再啟動mysql

復制代碼 代碼如下:

[root@local ~]# /usr/local/mysql/bin/mysqld_safe --user=mysql

注冊mysql服務,開機自動啟動

1.設置mysql配置文件到/etc目錄

復制代碼 代碼如下:

[root@local ~]# cp /usr/local/mysql/support-files/my-medium.cnf/etc/my.cnf 

2.設置mysql開機自啟

復制代碼 代碼如下:

[root@local ~]# cp/usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
[root@local ~]# chmod +x /etc/init.d/mysql
[root@local ~]# /sbin/chkconfig --add mysql

3.啟動mysql服務

復制代碼 代碼如下:

[root@local ~]# service mysql start 

測試mysql是否安裝成功

復制代碼 代碼如下:

[root@local ~]# /usr/local/mysql/bin/mysql -u root -p 
Enter password:  
Welcome to the MySQL monitor.  Commands end with ; or \g. 
Your MySQL connection id is 1 
Server version: 5.5.37 Source distribution 
  
Copyright (c) 2000, 2014, Oracle and/or itsaffiliates. All rights reserved. 
  
Oracle is a registered trademark of OracleCorporation and/or its 
affiliates. Other names may be trademarksof their respective 
owners. 
  
Type 'help;' or '\h' for help. Type '\c' toclear the current input statement. 
  
mysql> show databases; 
+--------------------+ 
| Database           | 
+--------------------+ 
| information_schema | 
| mysql              | 
| performance_schema | 
| test               | 
+--------------------+ 
4 rows in set (0.03 sec) 

相關文章

  • Mysql中新建用戶及授權的方法分享

    Mysql中新建用戶及授權的方法分享

    這篇文章給大家匯總介紹了Mysql中新建用戶及授權的方法,首先介紹的是作者自己的項目經(jīng)歷,后面附上了參考文章,希望能對大家學習mysql有所幫助。
    2016-07-07
  • mysql不走索引的幾個問題小結

    mysql不走索引的幾個問題小結

    MySQL中不走索引的問題通常發(fā)生在查詢中使用了函數(shù),這會使索引失效,從而影響查詢性能,本文就介紹了mysql不走索引的幾個問題小結,感興趣的可以了解一下
    2023-08-08
  • MySQL 數(shù)據(jù)庫 like 語句通配符模糊查詢小結

    MySQL 數(shù)據(jù)庫 like 語句通配符模糊查詢小結

    這篇文章主要介紹了MySQL 數(shù)據(jù)庫 like 語句通配符模糊查詢小結,本文給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2020-10-10
  • Mysql優(yōu)化方法詳細介紹

    Mysql優(yōu)化方法詳細介紹

    MySQL的優(yōu)化指的是一個很大的系統(tǒng),面試的時候我之前是從sql的語句優(yōu)化方面去說的,這種優(yōu)化也有作用,不過是從邏輯方面去優(yōu)化,下面這篇文章主要給大家介紹了關于MySQL查詢緩存優(yōu)化的相關資料,需要的朋友可以參考下
    2023-02-02
  • mysql 半同步復制模式使用小結

    mysql 半同步復制模式使用小結

    MySQL半同步復制是一種數(shù)據(jù)復制策略,它允許在主服務器和至少一個從服務器之間進行數(shù)據(jù)復制,本文主要介紹了mysql 半同步復制模式使用小結,具有一定的參考價值,感興趣的可以了解一下
    2023-09-09
  • MySQL全局共享內(nèi)存介紹

    MySQL全局共享內(nèi)存介紹

    這篇文章主要介紹了MySQL全局共享內(nèi)存介紹,全局共享內(nèi)存則主要是 MySQL Instance(mysqld進程)以及底層存儲引擎用來暫存各種全局運算及可共享的暫存信息,如存儲查詢緩存的 Query Cache,緩存連接線程的 Thread Cache等等,需要的朋友可以參考下
    2014-12-12
  • MySQL 5.7并發(fā)復制隱式bug實例分析

    MySQL 5.7并發(fā)復制隱式bug實例分析

    這篇文章主要給大家介紹了關于MySQL 5.7并發(fā)復制隱式bug的相關資料,文中介紹的非常詳細,對大家學習或者使用mysql5.7具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2018-11-11
  • Mysql根據(jù)某層部門ID查詢所有下級多層子部門的示例

    Mysql根據(jù)某層部門ID查詢所有下級多層子部門的示例

    這篇文章主要介紹了Mysql根據(jù)某層部門ID查詢所有下級多層子部門的示例,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2020-12-12
  • MySQL處理重復數(shù)據(jù)的學習筆記

    MySQL處理重復數(shù)據(jù)的學習筆記

    在本篇文章里小編給大家分享的是一篇關于MySQL處理重復數(shù)據(jù)的學習筆記,需要的朋友們可以參考下。
    2020-03-03
  • MySQL學習之數(shù)據(jù)庫表五大約束詳解小白篇

    MySQL學習之數(shù)據(jù)庫表五大約束詳解小白篇

    本篇文章非常適合MySQl初學者,主要講解了MySQL數(shù)據(jù)庫的五大約束及約束概念和分類,有需要的朋友可以借鑒參考下,希望可以有所幫助
    2021-09-09

最新評論