国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數(shù)據(jù)庫 > MySQL > 正文

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

2024-07-24 13:06:45
字體:
供稿:網(wǎng)友
這篇文章主要介紹了Centos5.5中安裝Mysql5.5過程分享,本文使用編譯方法安裝MySQL,并給出了一些可能遇到的錯誤和解決方法,需要的朋友可以參考下
 

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

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

安裝cmake

 

復(fù)制代碼代碼如下:

[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

 

復(fù)制代碼代碼如下:

[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 ./

 

可能還會報(bào)這個錯,沒有就跳過

 

復(fù)制代碼代碼如下:

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

 

復(fù)制代碼代碼如下:

[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 文件,否則無法進(jìn)行下一步

 

復(fù)制代碼代碼如下:

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

 

繼續(xù)編譯mysql

 

復(fù)制代碼代碼如下:

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

 

這樣,mysql默認(rèn)將成功安裝到/usr/local/mysql

創(chuàng)建mysql用戶組

 

復(fù)制代碼代碼如下:

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

 

啟動mysql

 

復(fù)制代碼代碼如下:

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

 

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

 

復(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.

 

解決方法:

 

復(fù)制代碼代碼如下:

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

 

再啟動mysql

 

復(fù)制代碼代碼如下:

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

 

注冊mysql服務(wù),開機(jī)自動啟動

1.設(shè)置mysql配置文件到/etc目錄

 

復(fù)制代碼代碼如下:

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

 

2.設(shè)置mysql開機(jī)自啟

 

復(fù)制代碼代碼如下:

[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服務(wù)

 

復(fù)制代碼代碼如下:

[root@local ~]# service mysql start  

 

測試mysql是否安裝成功

 

復(fù)制代碼代碼如下:

[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)  

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 顺平县| 昭平县| 朔州市| 鹿邑县| 武功县| 深泽县| 黄大仙区| 龙山县| 洪雅县| 玉环县| 兴义市| 墨江| 府谷县| 新安县| 增城市| 西城区| 乌兰浩特市| 汉阴县| 南阳市| 乌兰浩特市| 辛集市| 集贤县| 油尖旺区| 临朐县| 财经| 阳信县| 视频| 淮滨县| 甘德县| 乌什县| 宜丰县| 竹溪县| 漳平市| 永康市| 崇明县| 甘德县| 桦川县| 读书| 永嘉县| 夏津县| 东明县|