CentOS 5.5下安装MySQL 5.5全经过分享

centos编译安装mysql5.5,编译安装cmake  www.2cto.com  ,扩充并详尽地记录了整个过程,编译安装  www.2cto.com  ,email protected,在centos下安装mysql出现各种依赖关系,在linux下安装安装mysql

[[email protected]
~]# yum remove mysql

由来MySQL已经符合规律安装并能够应用

展开终端

启动mysql  

/usr/local/src/cmake-2.8.4/Bootstrap.cmk/cmake_bootstrap.log

报错:缺乏C的编写翻译器。  www.2cto.com  

 

安装gcc编译器

 

能够从Linux系统的装置盘中安装,也得以省略地用yum安装

 

[[email protected]
~]# yum install gcc

 

继续cmake的安装

 

[[email protected]
cmake-2.8.4]# ./bootstrap
 ——————————————— CMake 2.8.4, Copyright
2000-2009 Kitware, Inc. C compiler on this system is: cc
 ——————————————— Error when bootstrapping
CMake: Cannot find appropriate C++ compiler on this system. Please
specify one using environment variable CXX. See cmake_bootstrap.log for
compilers attempted. ——————————————— Log

[[email protected]
cmake-2.8.5]# ./bootstrap 

[[email protected]
~]# yum install gcc-c++

始建系统数据库的表

 

前边对于MySQL的施用可参看MySQL5.5参照他事他说加以考察手册。

Warning: Bison executable not found in
PATH有三个警示,也消除了它,贫乏Bison就安装一下

Warning: Bison executable not found in PATH

下载cmake源码包cmake-2.8.4.tar.gz,mv到/usr/local/src目录下

便利调用,为mysql设置一个软链接

**化解办法:安装gcc编写翻译器

  remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name
is libncurses5-dev, on Redhat and derivates it is ncurses-devel.

of errors: /usr/local/src/cmake-2.8.4/Bootstrap.cmk/cmake_bootstrap.log

再也报错:贫乏C++编写翻译器。

 

安装gcc-c++编译器  www.2cto.com  

 

一样能够从Linux系统的安装盘中安装,或许简单地用yum安装

 

[[email protected]
~]# yum install gcc-c++

 

再次上边的操作

 

[[email protected]
cmake-2.8.4]# ./bootstrap 

 

从没报错后,编写翻译安装

 

[[email protected]
cmake-2.8.4]# gmake
[[email protected]
cmake-2.8.4]# gmake install

 

起来正儿八经安装Mysql

 

增多mysql用户和用户组

 

[[email protected]
~]# groupadd mysql
[[email protected]
~]# useradd -g mysql mysql

 

下载mysql的源码包mysql-5.5.11.tar.gz到/usr/local/src下,解压

 

[[email protected]
~]# cd /usr/local/src/
[[email protected]
src]# tar xzvf mysql-5.5.11.tar.gz
[[email protected]
src]# cd mysql-5.5.11 

 

cmake运行

 

[[email protected]
mysql-5.5.11]# cmake .

 

报错:  www.2cto.com  

 

— Could NOT find Curses (missing:  CURSES_LIBRARY
CURSES_INCLUDE_PATH)  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. Call Stack (most recent call first):  
cmake/readline.cmake:126 (FIND_CURSES)   cmake/readline.cmake:216
(MYSQL_USE_BUNDLED_LIBEDIT)   CMakeLists.txt:250
(MYSQL_CHECK_READLINE)  — Configuring incomplete, errors occurred!
 

贫乏Curses包,消除办法:remove CMakeCache.txt  and rerun cmake.On
Debian/Ubuntu, package name is libncurses5-dev, on  Redhat and derivates
it is ncurses-devel.很轻巧看懂,不解释了…

 

在CentOS下要求安装ncurses-devel

 

[[email protected]
mysql-5.5.11]# yum install ncurses-devel

 

重新cmake运行

[[email protected]
mysql-5.5.11]# cmake .

  www.2cto.com  

要么有个警示

 

Warning: Bison executable not found in PATH

 

有多个警戒,也消除了它,贫乏Bison就安装一下

 

[[email protected]
mysql-5.5.11]# yum install bison

 

重新运维,没有报错

 

[[email protected]
mysql-5.5.11]# cmake .

 

在编写翻译安装前,能够设置安装的布署选项

 

[[email protected]
mysql-5.5.11]# ./configure –help

 

基于援救新闻采用自个儿须要设置的选项,当然也可以跳过那步,按暗中认可设置

金沙国际唯一官网网址, 

伊始编写翻译安装,时间稍微稍长,能够泡杯咖啡转悠一下…

 

[[email protected]
mysql-5.5.11]# make && make install

成功编写翻译安装  www.2cto.com  

 

进入安装目录,将顺序二进制的全数权改为root,数据目录的说有权改为mysql用户,更新授权表

 

[[email protected]
mysql-5.5.11]# cd /usr/local/mysql/
[[email protected]
mysql]# chown -R root .
[[email protected]
mysql]# chown -R mysql .
[[email protected]
mysql]# chgrp -R mysql .
[[email protected]
mysql]# scripts/mysql_install_db –user=mysql

 

康宁开发银行mysql

[[email protected]
mysql]# ./bin/mysqld_safe –user=mysql &

 

关闭mysql

[[email protected]
mysql]# ./bin/mysqladmin -u root shutdown -p

暗中认可密码为空

 

造福调用,为mysql设置三个软链接

[[email protected]
~]# ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql

 

有3种艺术为root账户设置密码:

  www.2cto.com  

使用SET PASSWORD语句

 

[[email protected]
~]# mysql -u root

mysql> SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘newpwd’);
mysql> SET PASSWORD FOR ‘root’@’host_name’ = PASSWORD(‘newpwd’)

运用mysqladmin命令行程序

 

[[email protected]
~]# mysqladmin -u root password “newpwd”
[[email protected]
~]# mysqladmin -u root -h host_name password “newpwd”

使用UPDATE语句

 

[[email protected]
~]# mysql -u root

mysql> UPDATE mysql.user SET Password = PASSWORD(‘newpwd’)     ->
    WHERE User = ‘root’; mysql> FLUSH PRIVILEGES;

 

任何装置管理:

 

安装选项文件,将配置文件拷贝到/etc下

 

[[email protected]
mysql]# cp support-files/my-medium.cnf /etc/mysql.cnf

 

设置开机自运转  www.2cto.com  

 

[[email protected]
mysql]# cp support-files/mysql.server /etc/init.d/mysql
[[email protected]
mysql]# chmod +x /etc/init.d/mysql 

 

后天得以透过服务来运转和停业Mysql

 

[[email protected]
~]# service mysql start
[[email protected]
~]# service mysql shutdown

 

繁多的装置就是这么了
 

安装Mysql5.5事先先卸载CentOS自带的Mysql5.0。
[[email protected]
~]# yum remove mysql 编写翻译安装cmake www.2cto.com
下载cmake源码包cmake-2.8…

平安开发银行mysql

mysql> QUIT

cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf 

centos编写翻译安装mysql5.5

[[email protected]
mysql]# chkconfig –add mysqld

其余装置管理:

[[email protected]
cmake-2.8.4]# make 

 

 

cmake运行

  cmake/readline.cmake:127 (FIND_CURSES)

 

#始发编写翻译安装,时间有些稍长…

下载cmake源码包cmake-2.8.5.tar.gz

 

设置Mysql5.5事先先卸载CentOS自带的Mysql5.0。

[[email protected]
mysql]# cp support-files/mysql.server /etc/init.d/mysql 

安装gcc-c++编译器

# .bash_profile

[[email protected]
~]# cd /usr/local/src/
[[email protected]
src]# tar xzvf cmake-2.8.4.tar.gz
 [[email protected]
src]# cd cmake-2.8.4
[[email protected]
cmake-2.8.4]# ./bootstrap
 ——————————————— CMake 2.8.4, Copyright
2000-2009 Kitware, Inc. ———————————————
Error when bootstrapping CMake: Cannot find appropriate C compiler on
this system. Please specify one using environment variable CC. See
cmake_bootstrap.log for compilers attempted.
 ——————————————— Log of errors:

[[email protected]
~]# wget

从那之后MySQL已经平常安装并能够运用

 

编写翻译安装cmake  www.2cto.com  

mysql> 提示符告诉您mysql妄图为你输入指令。

[[email protected]
~]# wget

centos 5.9安装mysql 5.5.31

 

[[email protected]
local]# tar xzvf mysql-5.5.27.tar.gz

[[email protected]
~]# su -安装Mysql5.5之前先卸载CentOS自带的Mysql5.0。

# Get the aliases and functions

 

设置Mysql5.5以前先卸载CentOS自带的Mysql5.0。

增多mysql用户和用户组

[[email protected]
mysql-5.5.31]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql
-DMYSQL_DATADIR=/usr/local/mysql/data -DDEFAULT_CHARSET=utf8
-DDEFAULT_COLLATION=utf8_general_ci

mysql> QUIT

[[email protected]
~]# groupadd mysql
[[email protected]
~]# useradd -g mysql mysql

  CMakeLists.txt:269 (MYSQL_CHECK_READLINE)

[[email protected]
~]# yum install gcc-c++

**再一次运维,未有报错

[[email protected]
~]# useradd -r -g mysql mysql

[[email protected]
mysql]# /usr/local/mysql/scripts/mysql_install_db –user=mysql
–basedir=/usr/local/mysql –datadir=/usr/local/mysql/data

[[email protected]
mysql-5.5.27]# yum install bison

 

 

安装cmake

 

 

切换来根目录
[[email protected]
~]# su -安装Mysql5.5事先先卸载CentOS自带的Mysql5.0。
[[email protected]
~]# yum remove mysql 安装cmake 下载cmake源码包…

[[email protected]
~]#  tar xzvf mysql-5.5.31.tar.gz

   www.2cto.com  

[[email protected]
mysql-5.5.27]# cd
/usr/local/mysql[[email protected]
mysql]# chown -R root .
[[email protected]
mysql]# chown -R mysql .
[[email protected]
mysql]# chgrp -R mysql .
[[email protected]
mysql]# scripts/mysql_install_db –user=mysql
起始化数据库[[email protected]
mysql]# /usr/local/mysql/scripts/mysql_install_db –user=mysql
–basedir=/usr/local/mysql –datadir=/usr/local/mysql/data
安全开发银行mysql

 

 

[[email protected]
cmake-2.8.5]# make
[[email protected]
cmake-2.8.5]# make
install[[email protected]
cmake-2.8.5]# cmake -version

  Curses library not found.  Please install appropriate package,

 

#发端编写翻译安装,时间有些稍长…
[[email protected]
mysql-5.5.27]# make && make install完毕编译安装

export PATH

双重上边的操作

[[email protected]
mysql-5.5.27]# cmake .依然有个警示

 

[[email protected]
~]# wget

老是服务器

[[email protected]
~]# groupadd mysql 

[[email protected]
cmake-2.8.5]# cmake -version

**[[email protected]
mysql-5.5.27]# cmake .在编写翻译安装前,能够安装安装的配备选项

如上面类似增加mysql路线

[[email protected]
mysql-5.5.27]# cmake .

[[email protected]
mysql-5.5.27]# cmake .

 

安装开机自运维

[[email protected]
mysql-5.5.27]# rm CMakeCache.txt
[[email protected]
mysql-5.5.27]# yum -y install ncurses-devel*

 

[[email protected]
mysql-5.5.27]# cmake .

[[email protected]
mysql]# ./bin/mysqld_safe –user=mysql关闭mysql

5.9安装mysql 5.5.31
在linux下安装安装mysql,会产出形形色色的依据关系,在centos下安装mysql出现各个重视关系
[[email protected]]#
tar xzvf cmake-…

消除办法:

设置选项文件,将安插文件拷贝到/etc下
[[email protected]
mysql]# cp support-files/my-medium.cnf /etc/mysql.cnf
设置开机自运维[[email protected]
mysql]# cp support-files/mysql.server /etc/init.d/mysql
[[email protected]
mysql]# chmod +x /etc/init.d/mysql
[[email protected]
mysql]# chkconfig –add
mysqld[[email protected]
mysql]# chkconfg mysqld on

 

尚未报错后,编写翻译安装

再次上边的操作

[[email protected]]#
tar xzvf cmake-2.8.4.tar.gz 

[[email protected]
mysql]# ./bin/mysqladmin -u root shutdown -p

今昔能够通过劳务来运行和关闭Mysql服务器

安装gcc编译器

[[email protected]
mysql-5.5.27]# cmake .

[[email protected]
~]# wget
 protected]](
tar xzvf cmake-2.8.5.tar.gz
[[email protected]]#
cd cmake-2.8.5
[[email protected]
cmake-2.8.5]# ./bootstrap Error when bootstrapping CMake: Cannot find
appropriate C compiler on this system. Please specify one using
environment variable CC. See cmake_bootstrap.log for compilers
attempted. 报错:紧缺C的编写翻译器。

 贫乏Curses包,化解办法:remove CMakeCache.txt  and rerun cmake.On
Debian/Ubuntu, package name is libncurses5-dev, on  Redhat and derivates
it is ncurses-devel.

[[email protected]
mysql-5.5.27]# ./configure –help

[[email protected]
mysql-5.5.27]# ./configure
–help遵照援救音信选用本人供给安装的选项,当然也得以跳过那步,按暗中同意设置

[[email protected]
cmake-2.8.4]# make install

下载mysql的源码包mysql-5.5.27.tar.gz

[[email protected]
~]# service mysql start
[[email protected]
~]# service mysql shutdown