最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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 已經(jīng)運行多長時間的方法

    查看 MySQL 已經(jīng)運行多長時間的方法

    查看MySQL啟動時間以及運行了多長時間的方法有利用show與updtime或在linux中直接使用grep mysql 相關參數(shù)來查看,下面我們一起來看看
    2014-01-01
  • MySQL性能優(yōu)化之路---修改配置文件my.cnf

    MySQL性能優(yōu)化之路---修改配置文件my.cnf

    mysql數(shù)據(jù)庫的優(yōu)化,算是一個老生常談的問題了,網(wǎng)上也有很多關于各方面性能優(yōu)化的例子,今天我們要談的是MySQL 系統(tǒng)參數(shù)的優(yōu)化即優(yōu)化my.cnf文件
    2014-06-06
  • SQL多表聯(lián)查的幾種方法示例總結(jié)

    SQL多表聯(lián)查的幾種方法示例總結(jié)

    本文詳細介紹了SQL中不同類型的連接操作,包括內(nèi)連接、左外連接、右外連接、全外連接、交叉連接、自連接及其排除內(nèi)連接的特殊應用,每種連接類型都提供了語法說明和具體示例,幫助理解如何在實際中應用這些連接來處理和分析數(shù)據(jù),需要的朋友可以參考下
    2024-09-09
  • MySQL 添加注釋(comment)的方法步驟

    MySQL 添加注釋(comment)的方法步驟

    本文主要介紹了MySQL添加注釋(comment)的方法步驟,字段或列的注釋是用屬性comment來添加,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2024-05-05
  • mysql 5.7.17 以及workbench安裝配置圖文教程

    mysql 5.7.17 以及workbench安裝配置圖文教程

    這篇文章主要為大家詳細介紹了mysql 5.7.17 以及workbench安裝配置圖文教程,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2019-06-06
  • Ubuntu 18.04下mysql 8.0 安裝配置方法圖文教程

    Ubuntu 18.04下mysql 8.0 安裝配置方法圖文教程

    這篇文章主要為大家詳細介紹了Ubuntu 18.04下mysql 8.0 安裝配置方法圖文教程,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2018-05-05
  • mysql中l(wèi)imit的用法深入分析

    mysql中l(wèi)imit的用法深入分析

    本篇文章是對mysql中l(wèi)imit的用法進行了詳細的分析介紹,需要的朋友參考下
    2013-06-06
  • MySQL定時器EVENT學習筆記

    MySQL定時器EVENT學習筆記

    本文為大家介紹下MySQL定時器EVENT,要使定時起作用 MySQL的常量GLOBAL event_scheduler必須為on或者是1,感興趣的朋友可以了解下
    2013-11-11
  • 深入理解Mysql事務隔離級別與鎖機制問題

    深入理解Mysql事務隔離級別與鎖機制問題

    MySQL默認的事務隔離級別是可重復讀,用Spring開發(fā)程序時,如果不設置隔離級別默認用MySQL設置的隔離級別,如果Spring設置了就用已設置的隔離級別,本文重點給大家介紹Mysql事務隔離級別與鎖機制的相關知識,一起看看吧
    2021-09-09
  • MySQL for update鎖表還是鎖行校驗(過程詳解)

    MySQL for update鎖表還是鎖行校驗(過程詳解)

    在MySQL中,使用for update子句可以對查詢結(jié)果集進行行級鎖定,以便在事務中對這些行進行更新或者防止其他事務對這些行進行修改,這篇文章主要介紹了MySQL for update鎖表還是鎖行校驗,需要的朋友可以參考下
    2024-02-02

最新評論

巴中市| 即墨市| 寿阳县| 固始县| 泗水县| 永修县| 抚宁县| 上杭县| 东台市| 云林县| 遂溪县| 四子王旗| 蒙自县| 进贤县| 玉门市| 临沂市| 从江县| 高清| 西乌珠穆沁旗| 勃利县| 万宁市| 浦县| 白玉县| 平谷区| 长白| 清涧县| 伽师县| 鹤峰县| 东兴市| 唐山市| 灵川县| 正蓝旗| 略阳县| 靖西县| 读书| 孟连| 泸定县| 博野县| 宜都市| 大化| 伊春市|