源码编译安装mysql-5.5.34|笔记
2014-03-25 15:44
597 查看
Hi 大家好,我是钟义林 我们来安装mysql,下面是笔记的原稿。下面我开始吧
首先下载cmakewget http://www.cmake.org/files/v2.8/cmake-2.8.12.1.tar.gz #下载Curseswget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz yum install bison yum install ncurses-devel ncurses openssl-devel
然后下载mysqlwget http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.34.tar.gz 连接失效了,可能你需要去mysql的官网登入一下
tar zxvf cmake-2.8.12.1 && tar zxvf mysql-5.5.34tar.gz
cd cmake-2.8.12.1 ./bootstrap && gmake && make && make install
tar zxvf mysql-5.5.34.tar.gz
cd msyql-5.5.34
cmake . \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql/ \
-DINSTALL_DATADIR=/usr/local/mysql/data/ \
-DSYSCONFDIR=/usr/local/mysql/etc \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DEXTRA_CHARSETS=all \
-DWITH_SSL=system \
-DWITH_EMBEDDED_SERVER=1 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DMYSQL_USER=mysql \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/data/mysql.sock
================================================================================================
#cp support-files/my-default.cnf /usr/local/mysql/etc/my.cnf (版本问题 可能没有这些配置文件)
#[root@Nutcracker support-files]# pwd
/usr/local/mysql/support-files
[root@Nutcracker support-files]# ls
binary-configure my-huge.cnf mysqld_multi.server
config.huge.ini my-innodb-heavy-4G.cnf mysql-log-rotate
config.medium.ini my-large.cnf mysql.server
config.small.ini my-medium.cnf ndb-config-2-node.ini
magic my-small.cnf solaris
#这里说明一下,你可以吧你需要的.cnf文件cp到 /etc下 改名没my.conf
===================================================================================================
shell> groupadd mysql
shell> useradd -r -g mysql mysql
shell> cd /usr/local/mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
如果出现下列警告,请暂时忽略
ARNING: The host 'Nutcracker' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h Nutcracker password 'new-password'
Alternatively you can run:
./bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd ./mysql-test ; perl mysql-test-run.pl
Please report any problems with the ./bin/mysqlbug script!
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
shell> chown -R root .
shell> chown -R mysql data
shell> bin/mysqld_safe --user=mysql &
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
/usr/local/mysql/scripts/mysql_install_db \
--defaults-extra-file=/etc/my.cnf \
--basedir=/usr/local/mysql \
--datadir=/usr/local/mysql \
--user=mysql
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
请忽略警告信息,成功
WARNING: The host 'Nutcracker' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE 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 Nutcracker password 'new-password'
Alternatively you can run:
/usr/local/mysql/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly 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.pl
cd /usr/local/mysql/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/local/mysql/scripts/mysqlbug script!
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/usr/local/mysql/bin/mysqladmin -u root password 'newpassword' #mysqDB root的密码
cp support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
/etc/init.d/mysqld start (启动mysql)
yum install mysql 安装连接mysql客户端
本文出自 “钟义林” 博客,请务必保留此出处http://zhongyilin.blog.51cto.com/5389262/1383870
首先下载cmakewget http://www.cmake.org/files/v2.8/cmake-2.8.12.1.tar.gz #下载Curseswget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz yum install bison yum install ncurses-devel ncurses openssl-devel
然后下载mysqlwget http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.34.tar.gz 连接失效了,可能你需要去mysql的官网登入一下
tar zxvf cmake-2.8.12.1 && tar zxvf mysql-5.5.34tar.gz
cd cmake-2.8.12.1 ./bootstrap && gmake && make && make install
tar zxvf mysql-5.5.34.tar.gz
cd msyql-5.5.34
cmake . \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql/ \
-DINSTALL_DATADIR=/usr/local/mysql/data/ \
-DSYSCONFDIR=/usr/local/mysql/etc \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DEXTRA_CHARSETS=all \
-DWITH_SSL=system \
-DWITH_EMBEDDED_SERVER=1 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DMYSQL_USER=mysql \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/data/mysql.sock
================================================================================================
#cp support-files/my-default.cnf /usr/local/mysql/etc/my.cnf (版本问题 可能没有这些配置文件)
#[root@Nutcracker support-files]# pwd
/usr/local/mysql/support-files
[root@Nutcracker support-files]# ls
binary-configure my-huge.cnf mysqld_multi.server
config.huge.ini my-innodb-heavy-4G.cnf mysql-log-rotate
config.medium.ini my-large.cnf mysql.server
config.small.ini my-medium.cnf ndb-config-2-node.ini
magic my-small.cnf solaris
#这里说明一下,你可以吧你需要的.cnf文件cp到 /etc下 改名没my.conf
===================================================================================================
shell> groupadd mysql
shell> useradd -r -g mysql mysql
shell> cd /usr/local/mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
如果出现下列警告,请暂时忽略
ARNING: The host 'Nutcracker' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h Nutcracker password 'new-password'
Alternatively you can run:
./bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd ./mysql-test ; perl mysql-test-run.pl
Please report any problems with the ./bin/mysqlbug script!
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
shell> chown -R root .
shell> chown -R mysql data
shell> bin/mysqld_safe --user=mysql &
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
/usr/local/mysql/scripts/mysql_install_db \
--defaults-extra-file=/etc/my.cnf \
--basedir=/usr/local/mysql \
--datadir=/usr/local/mysql \
--user=mysql
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
请忽略警告信息,成功
WARNING: The host 'Nutcracker' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE 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 Nutcracker password 'new-password'
Alternatively you can run:
/usr/local/mysql/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly 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.pl
cd /usr/local/mysql/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/local/mysql/scripts/mysqlbug script!
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/usr/local/mysql/bin/mysqladmin -u root password 'newpassword' #mysqDB root的密码
cp support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
/etc/init.d/mysqld start (启动mysql)
yum install mysql 安装连接mysql客户端
本文出自 “钟义林” 博客,请务必保留此出处http://zhongyilin.blog.51cto.com/5389262/1383870
相关文章推荐
- MySQL5.7.18源码编译安装笔记【Ubuntu篇】
- 【MySQL学习笔记】CentOS 6.6上源码编译方式安装MySQL 5.6
- MySQL5.7.18源码编译安装笔记【CentOS篇】
- MySQL学习笔记之二:源码编译安装和二进制格式安装MariaDB
- mysql-5.5.34源码编译安装,多实例配置
- Linux下MySQL 5.5.11源码编译安装笔记
- SUSE Linux源码编译安装MySQL 5.6
- 32位win7+vs2008编译mysql 5.6.22源码并安装
- linux下安装mysql(编译mysql源码)
- Linux 下 MySQL 5.5.8 源码编译安装记录
- Linux 下 mysql 的安装 (编译源码的方式)
- Linux源码安装mysql 5.5.13 (cmake编译)
- Mysql5.5.22源码编译安装
- RHEL 6.5 64bit下源码编译安装LAMP(Apache 2.4.12、MySQL 5.5.42、PHP 5.3.10)
- Mysql 源码编译安装 ( 5.5 、5.6 共存 )
- CentOS5.6下使用cmake编译MySQL5.5.13源码和安装笔录
- linux笔记—-mysql 数据库安装与配置(源码)
- 在Ubuntu-12.04.2上编译安装MySQL-5.6.10[安装笔记]
- MySQL 5.7.9源码编译安装步骤