一,准备工作
1,快速安装安装 CentOS6,安装时选择最小化安装.
2,安装mysql编译时需要的库文件,这时可以选择做光盘yum
[root@admin share] # cd /media/
[root@admin media] # mkdir CentOS
[root@admin media] # mount /dev/cdrom /media/CentOS
[root@admin media]# cd /etc/yum.repos.d/
[root@admin yum.repos.d] # mv CentOS-Base.repo CentOS-Base.repo.bak
[root@admin yum.repos.d] # mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo.bak
至此,用光盘做的yum就可用了;
[root@admin ~]#yum --enablerepo=c6-media install ncurses* gcc* perl* -y
3,准备好安装包. (这里以 mysql-5.0.56.tar.gz举例)
4,添加mysql 用户
[root@admin ~]#groupadd mysql
[root@admin ~]#useradd -g mysql mysql -s /bin/nologin
二,正式安装
1. [root@admin software]#tar zxvf mysql-5.0.56.tar.gz
2. [root@admin software]# cd mysql-5.0.56
3. [root@admin mysql-5.0.56]# ./configure --prefix=/usr/local/mysql --localstatedir=/data/mysql --enable-assembler -- enable-static --with-mysqld-user=mysql --with-big-tables --enable-thread-safe-client -- enable-local-infile --with-charset-utf8 --with-extra-charsets=all
4. [root@admin mysql-5.0.56]# make && make install
5. [root@admin mysql-5.0.56]# cp support-files/my-medium.cnf /etc/my.cnf
6. [root@adim share]# cd /usr/local/mysql/
7. [root@admin mysql]# bin/mysql_install_db --user=mysql
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 localhost.localdomain 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 mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/local/mysql/bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
8. [root@admin mysql]# chown -R mysql.mysql /data/mysql/
9. [root@admin mysql]# share/mysql/mysql.server start
Starting MySQL SUCCESS! #--------------> 看到如此,便知道安装成功了.
10. [root@admin mysql]# netstat -tunlp | grep mysql
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 13193/mysqld
三. 后绪工作
1.[root@admin ~]# ln -s /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
2.[root@admin ~]# ln -s /usr/local/mysql/bin/mysql /usr/sbin/mysql
3.[root@admin ~]# ln -s /usr/local/mysql/bin/mysqladmin /usr/sbin/mysqladmin
4.[root@admin ~]# ln -s /usr/local/mysql/bin/mysqldump /usr/sbin/mysqldump
5.[root@admin ~]# mysql -uroot -p
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.56-log Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
分享到:
相关推荐
CentOS 6.4下编译安装MySQL 5.7.9
CentOS编译安装MYSQL5.6.17---验证成功
centos7下编译安装mysql5.7.17
centos6.3中编译安装mysql.5.5.30.pdf
Linux CentOS6.5下编译安装MySQL 5.6.16.docx
针对在CentOS7.1编译安装mysql-5.7.7遇到各种各样的困难的人,或许有点作用
Linux系统:CentOS 6.5版本下编译安装MySQL 5.6.16教程,涉及:linux基础命名,Mysql安装教程以及注意事项。
如何在centos系统下编译安装mysql。 编译安装mysql可以自定义安装路径,属性等资料。经常会用到。
mysql数据库在centos下安装技巧、优化,mysql数据库在centos下安装技巧、优化, mysql数据库在centos下安装技巧、优化mysql数据库在centos下安装技巧、优化
centos6.3中编译安装mysql.5.5.30定义.pdf
centos6.3中编译安装mysql.5.5.30借鉴.pdf
centos6.3中编译安装mysql.5.5.30文.pdf
2-CentOS6安装MySQL5.71
centos7编译安装mysql
centos6.3中编译安装mysql.5.5.30[参照].pdf
说明: 操作系统:CentOS 5.9 64 位 ...MySQL 安装目录:/usr/local/mysql MySQL 数据库存放目录:/data/mysql 准备篇: 一、配置好IP、DNS 、网关,确保使用远程连接工具能够连接服务器,服务器yum 命令可 以正常使用
本文档介绍了在CentOS6.3编译安装mysql源码包的祥细步骤,带各种命令参数的说明,附带可能出现错误的解决方法。
CentOS 6.4下Mysql 5.7编译安装
一、安装MySQL 1、安装cmake cd /usr/local/src tar zxvf cmake-2.8.11.2.tar.gz cd cmake-2.8.11.2 ./configure make make install 2、安装MySQL groupadd mysql #添加mysql组 useradd -g mysql mysql -s...
主要介绍了CentOS 6.6 源码编译安装MySQL 5.7.18教程详解,需要的朋友可以参考下