首先是到mysql官方网站下载 mysql6.0 到本地计算机上
这里我们选择 6.0 的版本
Source downloads
Note that in the more recent MySQL 5.0 and 5.1 releases, Windows binaries are built from the
same source as the Unix/Linux source TAR.
Compressed GNU TAR archive (tar.gz) 6.0.4-alpha 27.8M Download | Pick a mirror
MD5: 3f923f06815129567dd54657f1238271 | Signature
下载 源代码, 我们会在CentOS5.1 上编译安装,所以选择 Source downloads
>> No thanks, just take me to the downloads! 如果你不想登陆 ,直接点击这里可以
FTP
Taiwan [Providence University] HTTP FTP
Taiwan [National Taiwan University] HTTP FTP
Taiwan [I-SHOU University] HTTP
Thailand [THAIWEB.network] HTTP
自己测试 随便那个觉得比较快就用那个来下载, 具体下载我就演示了,用个下载软件比较快
我已经下载好了。下面启动 虚拟机,等下看我演示如何将 mysql-6.0.4-alpha.tar.gz 传到虚拟机上的
CentOS5.1 操作系统上去。
我用 putty 登陆上CentOS5.1, Linux 的ip是192.168.1.118
通过一个工具 webserver 在window上架设一个简单的web服务器
http://www.17rumen.com/download/tools/webserver.7z 下载webserver这个工具
http://127.0.0.1:2000 测试 webserver 是否成功工作 , 看到这个页面表示成功了
192.168.1.101 这是我 window 的ip地址。 最后看我操作
mysql-6.0.4-alpha.tar.gz 放进 webserv 目录
在CentOS5.1上通过 get命令来获取刚才我们下载的 mysql-6.0.4-alpha.tar.gz
[root@localhost opt]# wget http://192.168.1.101:2000/mysql-6.0.4-alpha.tar.gz
刚才复制 多了一些东西, 我们再下载一次
如果你的CentOS5.1出现网络问题,请看一个视频教程
来解决虚拟机上CentOS5.1上网的网络问题,那个视频是Redhat9.0上演示的同样适合CentOS5.1
解压
src]# tar vxzf mysql-6.0.4-alpha.tar.gz
把 mysql-6.0.4-alpha 移动到 /usr/local/src 下
mv mysql-6.0.4-alpha /usr/local/src
进入目录 cd mysql-6.0.4-alpha
]# ./configure --sysconfdir=/etc 注意没有空格的
出现一个错误:
checking for termcap functions library... configure: error: No curses/termcap library found
正确的解决做法应该是
yum -y install ncurses-devel
稍等, 网络不是很快.
还有一些更新地址出现time out 超时的情况,
不过它会(Trying other mirror)自动换另外一个镜像地址,挺方便。
Running Transaction
Installing: ncurses-devel ######################### [1/1]
Installed: ncurses-devel.i386 0:5.5-24.20060715
Complete!
安装完成。
====================
再次
]# ./configure --sysconfdir=/etc
就成功了。Thank you for choosing MySQL!
]#make
make 的时间也是比较长,要等等。
好了, 下面进行安装
]#make install
安装完了之后,我们拷贝一个配置文件,当作以后mysql的配置文件
]# cp /usr/local/share/mysql/my-large.cnf /etc/my.cnf
# useradd -d /usr/local/var mysql
# su - mysql
$ /usr/local/bin/mysql_install_db
启动
[mysql@localhost var]$ /usr/local/bin/mysqld_safe &
按多几下回车就可以了
测试
] netstat -tnl 查看端口, 看到 3306 就是mysql 的默认端口,
显示3306端口表示成功启动了mysql
登陆上去
[mysql@localhost local]$ mysql -uroot
mysql> show databases; 这是显示所有数据库命令
成功的话, 出现
mysql>
mysql>\s
mysql Ver 14.14 Distrib 6.0.4-alpha, for redhat-linux-gnu (i686) using EditLine wrapper
Connection id: 1
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 6.0.4-alpha-log Source distribution
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
UNIX socket: /tmp/mysql.sock
Uptime: 1 min 20 sec
Threads: 1 Questions: 6 Slow queries: 0 Opens: 15 Flush tables: 1 Open tables: 8 Queries
per second avg: 0.75
--------------
mysql>\q 这是退出命令
好下面做另外的修改,就是当启动 CentOS5.1 Linux 时候,mysql6.0也自动启动的问题
] su - 我们要用管理员身份才可以 进行下面的操作
]# echo "/usr/local/bin/mysqld_safe &" >> /etc/rc.local
]# more /etc/rc.local 查看是否添加成功。
]# shutdown -r now 重启Linux 看看 是否成功
看到了吧, 3306端口自动打开了。我们登陆mysql看看
好了, 编译安装mysql6.0 就演示到这里,谢谢大家的支持
如果你在 CentOS5.1 上遇到不能上网,请看下面的一篇视频教程,来解决网络上的问题。
http://www.17rumen.com/archives/8.html 虽然视频是Redhat9.0 上演示的,但是同样适合与CentOS5.1
07月 2nd, 2008 at 23:34:59 #itans
版主,你好。在这里想请教一下!
我按照你这篇教程做。前面都很顺利,到了make的时候就一直死循环,过不了。
报错是:if g++ -DMYSQL_SERVER -DDEFAULT_MYSQL_HOME="\"/usr/local\"" -DDATADIR="\"/usr/local/var\"" -DSHAREDIR="\"/usr/local/share/mysql\"" -DPLUGINDIR="\"/usr/local/lib/mysql/plugin\"" -DHAVE_CONFIG_H -I. -I. -I../include -I../zlib -I../include -I../include -I../regex -I. -O3 -fno-implicit-templates -fno-exceptions -fno-rtti -MT mysqld.o -MD -MP -MF ".deps/mysqld.Tpo" -c -o mysqld.o mysqld.cc; \
then mv -f ".deps/mysqld.Tpo" ".deps/mysqld.Po"; else rm -f ".deps/mysqld.Tpo"; exit 1; fi
请指点下。谢谢了!
[回复]
07月 2nd, 2008 at 23:40:26 #itans
在此还要感谢你提供这么好的教程。呵呵。
谢谢了!
我的QQ:78265036,请加我指点一下!
[回复]
07月 8th, 2008 at 01:32:15 #itans
我的邮件是itans@163.com
如果不方便留QQ的话,发个EMAIL好吗?
谢谢了。。。困扰好几天了。!
[回复]
07月 9th, 2008 at 10:40:31 #龚志惠
我装的mysql版本是6.0.4-alpha-community,创建存储过程
use heyall;
create procedure aa() select * from city;不能创建
但如果这样
use heyall;
set sql_mode='';
create procedure aa() select * from city;就可以
但如果象别人写的
create procedure aa()
begin
select * from city;
end
就会报错,不明白是什么原因啊
我又考虑是否是分界符的问题,如是按下面的方式进行
delimiter //
create procedure aa()
begin
select * from yumiao;
end//
delimiter;
奇怪的是我敲到end//, 回车后就报错,根本不允许继续往下敲了
是不是这个版本根本就不支持begin end啊,请回复!!!
[回复]
adminreply on 2008-08-05 23:09:54:
不是的,这个版本是支持begin end, 只是有些符号写错了,
下面是我的做法
mysql> delimiter //
mysql > create procedure aa()
-> begin
-> select * from city;
-> end;
-> //
Query OK, 0 rows affected (0.01 sec)
08月 5th, 2008 at 22:42:48 #admin
实在有点不好意思,前阵子有些忙 来不及回复。
因为做教程时候mysql6.0还不是正式发布版,而且是我是在虚拟机上做的测试,
“到了make的时候就一直死循环,过不了” 也许是测试版本的问题,
不知道你运行mysql6.0和我的环境一样?具体说说看。
[回复]
龚志惠reply on 2008-08-08 14:07:19:
谢谢,我已经解决了!
09月 9th, 2008 at 03:42:40 #angie
mysql-6.0.6-alpha
我现在安装的是这个版本的前面所有的都没有问题,和您的一模一样
可是到了make install这一步的时候提示
在包含自 mysys_priv.h:16 的文件中,
从 my_new.cc:21:
../include/my_global.h:1520:15: 错误:new:没有那个文件或目录
../include/my_global.h:1108: 错误:对 C++ 内建类型 ‘bool’ 的重声明
make[1]: *** [my_new.o] 错误 1
make[1]: Leaving directory `/usr/local/src/mysql-6.0.6-alpha/mysys'
make: *** [install-recursive] 错误 1
[回复]
fanzgreply on 2008-09-14 15:36:41:
这个版本我没有做测试,不过都不是正式发布版本,或者换我的那个版本试下。再不然等下个版本吧,呵呵。
11月 2nd, 2008 at 21:30:34 #lurkerming
您好,打扰了
请问,按照你的安装步骤,能够运行mysql.
但是到安装phpmyadmin后,发现没有gbk , 和 gb2312这两个编码格式。
我觉得,这很重要。请给出解决办法。谢谢
[回复]
11月 25th, 2008 at 20:15:06 #admin
如果是你是指mysql没有gbk , 和 gb2312这两个编码格式,你只要修改配置mysql配置文件,再重新运行mysql就可以。具体操作可以参照:
查看和修改MySql6.0数据库编码
http://www.17rumen.com/archives/48.html
[回复]
12月 2nd, 2008 at 19:45:13 #linfenglt
谢谢您的教程很详细,我也有点基础,可是老是出问题,现在问题又出来了,我都安照教程做好几遍了,还是不行,帮帮我看看,问题是
编译安装MySql6.0.4-alpha到
#make install
安装完了之后,我们拷贝一个配置文件,当作以后mysql的配置文件
]# cp /usr/local/share/mysql/my-large.cnf /etc/my.cnf
# useradd -d /usr/local/var mysql
# su - mysql
都一切正常,下面这一步报错
★$ /usr/local/bin/mysql_install_db!!!!!
下面是报错内容
[mysql@www bin]$ mysql_install_db
Installing MySQL system tables...
081202 19:33:09 [ERROR] /usr/local/libexec/mysqld: unknown option '--skip-federated'
081202 19:33:09 [ERROR] Aborting
081202 19:33:09 [Note] /usr/local/libexec/mysqld: Shutdown complete
Installation of system tables failed! Examine the logs in
/usr/local/var for more information.
You can try to start the mysqld daemon with:
shell> /usr/local/libexec/mysqld --skip-grant &
and use the command line tool /usr/local/bin/mysql
to connect to the mysql database and look at the grant tables:
shell> /usr/local/bin/mysql -u root mysql
mysql> show tables
Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /usr/local/var that may be helpful.
The latest information about MySQL is available on the web at
http://www.mysql.com/. Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS. Another information source are the
MySQL email archives available at http://lists.mysql.com/.
Please check all of the above before mailing us! And remember, if
you do mail us, you MUST use the /usr/local/bin/mysqlbug script!
我一直在等哦,谢谢了!我用的是安装盘是CentOS-5.2-i386-bin-DVD.iso
mysql-6.0.7-alpha.tar.gz
[回复]
adminreply on 2009-02-14 13:46:34:
有位网友是这样解决,你尝试下吧
只要将/etc/my.cnf文件中的skip-federated注释掉即可
12月 23rd, 2008 at 21:48:59 #siemenliu
你好,感谢你的教程让我受益匪浅
我在按照你说的做得途中好像出了一点问题
081224 5:42:57 [ERROR] /usr/local/libexec/mysqld: unknown option '--skip-federated'
081224 5:42:57 [ERROR] Aborting
081224 5:42:57 [Note] /usr/local/libexec/mysqld: Shutdown complete
网上说是bug?该怎么解决呢
[回复]
12月 23rd, 2008 at 22:13:13 #siemenliu
http://www.cnitblog.com/shisanlangd/archive/2008/10/14/50173.aspx
问题解决了。。。看了这个之后
MySQL安装错误:/usr/local/mysql/libexec/mysqld: unknown option '--skip-federated'
今天在CentOS5.2下源码安装MySQL5.1.28出现如下错误
Installing MySQL system tables...
[ERROR] /usr/local/mysql/libexec/mysqld: unknown option '--skip-federated'
[ERROR] Aborting
[Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
只要将/etc/my.cnf文件中的skip-federated注释掉即可
[回复]
adminreply on 2009-02-14 13:41:39:
呵呵,谢谢你的分享,因为当时用mysql6.0还是测试版本
01月 16th, 2009 at 13:14:42 #xiaoqiang
[mysql@localhost ~]$ /usr/local/bin/mysql_install_db
Installing MySQL system tables...
090116 7:30:03 [ERROR] /usr/local/libexec/mysqld: unknown option '--skip-federated'
090116 7:30:03 [ERROR] Aborting
090116 7:30:04 [Note] /usr/local/libexec/mysqld: Shutdown complete
Installation of system tables failed! Examine the logs in
/usr/local/var for more information.
You can try to start the mysqld daemon with:
shell> /usr/local/libexec/mysqld --skip-grant &
and use the command line tool /usr/local/bin/mysql
to connect to the mysql database and look at the grant tables:
shell> /usr/local/bin/mysql -u root mysql
mysql> show tables
Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /usr/local/var that may be helpful.
The latest information about MySQL is available on the web at
http://www.mysql.com/. Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS. Another information source are the
MySQL email archives available at http://lists.mysql.com/.
Please check all of the above before mailing us! And remember, if
you do mail us, you MUST use the /usr/local/bin/mysqlbug script!
在进行这步骤(/usr/local/bin/mysql_install_db)时,会出现上面的情况,继续你下面的步骤就会出错,则是什么原因
[回复]
adminreply on 2009-02-14 13:37:49:
安装完了之后,我们拷贝一个配置文件,当作以后mysql的配置文件
]# cp /usr/local/share/mysql/my-large.cnf /etc/my.cnf
# useradd -d /usr/local/var mysql
# su - mysql
$ /usr/local/bin/mysql_install_db
确认这些步骤。。。
02月 21st, 2009 at 04:15:18 #huanle
当我进行完# useradd -d /usr/local/var mysql
# su - mysql
$ /usr/local/bin/mysql_install_db
这些后,/usr/local/bin/mysqld_safe & 我运行这一步,我电脑就会卡在这个地方不动了.出现的是
090221 08:43:13 mysqld_safe mysqld from pid file /usr/local/var/localhost.localdomain.pid ended
我enter后又出现
[1]+ Done /usr/local/bin/mysqld_safe
我又运行netstat -ntl找不到开放有3306端口,郁闷很久了.
我的环境是centos5.2的,mysql版本是mysql-6.0.9-alpha.tar.gz,请各位大虾帮助,谢谢
[回复]
adminreply on 2009-02-21 12:08:04:
cp /usr/local/share/mysql/mysql.server /etc/init.d/mysqld 后才能使用
mysql 重启的命令为:/etc/init.d/mysqld restart
mysql 关闭的命令为:/etc/init.d/mysqld stop
mysql 启动的命令为:/etc/init.d/mysqld start
我在编译 mysql 5.0 时可以使用上面的方法,
具体可以看 http://www.17rumen.com/archives/11.html
02月 22nd, 2009 at 01:11:52 #huanle
谢谢管理员耐心的解答,支持本网站,我喜欢这个网站原创精神,我会常常来的,也希望管理员能出更多的教程,来教我们这些菜鸟.
[回复]
06月 3rd, 2009 at 19:12:09 #hardy
参照全部装完以后发现之前着急了点没有设置MYSQL的秘密
等我安装完了PHPMYADMIN以后回来执行mysql -uroot 以后输入我的系统密码进不去了。。
[回复]
adminreply on 2009-06-05 06:56:58:
。。。。。。。
是不是在 phpmyadmin 中修改了 root 的密码?
如果没有的话,这种情况应该不会发生吧,注意检查一下,呵呵。
06月 29th, 2009 at 21:01:49 #xajhzc
我下载的是centos5.3,DVD版本
按视频一的讲解只安装Development Tools以后
输入wget,提示找不到命令。郁闷死了……
[回复]
xajhzcreply on 2009-06-29 21:05:43:
嘿嘿,刚才BAIDU了一下,发现WGET本身就是一个软件
刚下载完了,明天再去机房试试~~~
06月 29th, 2009 at 21:08:46 #xajhzc
刚反应过来,对于这么一个机器,我怎么才能把wget给它传进去呢……
还是请管理员解答一下……
这几天每天写十二小时代码,反应有点慢,不好意思……
[回复]
adminreply on 2009-07-04 20:52:56:
]# yum -y install wget
这样就可以安装使用 wget 了。前提你的机器要可以访问互联网,呵呵。
07月 16th, 2009 at 17:28:32 #wangqi
我想问一下我在cent5.4下安装数据库mysql可是我到那里也找不到
mysql-6.0.4-alpha.tar.gz的下载链接了,请问可以用别的版本来找替或到那里可以下载 急
[回复]
adminreply on 2009-07-18 20:11:58:
http://www.mysql.com/
这是 mysql 的官方网站,其他版本都可以吧。呵呵
08月 6th, 2009 at 19:37:37 #您好!
我按照网页里的要求,用了相同版本的mysql安装的时候,比较顺利!到了”netstat -tnl 查看端口“,也看到”3306端口了.但是下面的就出错了“【mysql@localhost local]mysql -uroot ",提示我”/Access denied for user 'root'@loca(using password No)",好像密码部分出问题了!但是我输入管理员密码、admin等等都不对!这是怎么回事!我都装了好几遍了!还是这样!
还请高手帮忙啊!谢谢了!
[回复]
adminreply on 2009-08-12 17:50:07:
"mysql@localhost local]mysql -uroot "
你这个登陆语句是没有密码时候才用来登陆的,
如果有密码是 123 的话
]#mysql -uroot -p123
试一下, 我也不知道你有没有设置密码。
08月 14th, 2009 at 10:30:20 #您好!
绝对没有设置密码!那我试试!
[回复]
12月 25th, 2009 at 18:56:13 #匿名
你好,你们的视频教程很好,可就是没有声音啊,avi格式的windows无法播放,请问用什么播放器呀?
[回复]
adminreply on 2009-12-27 12:12:14:
谢谢你的支持。是的,是通过文字进行解说的。普通的播放器就应该可以播放的呀,用windows 自带播放器也可以的,avi格式的视频文件,应该是最多播放器所支持的格式吧。 怎么会不能播放 ? 可以说一下具体出现什么问题?真的很少人向我反映不能播放。
08月 17th, 2010 at 12:14:42 #mdy
我安装到make install
make[3]: Nothing to be done for `install-exec-am'.
make INSTALL_TO_DIR="/usr/local/mysql-test" install_test_files
make[4]: Entering directory `/usr/local/src/mysql-5.1.49/mysql-test'
到这里不走了。卡住了。请问怎么回事???
[回复]
mdyreply on 2010-08-17 13:57:37:
好了。呵呵。已经装好Mysql 了,开始学习你的安装php
adminreply on 2010-08-17 17:45:45:
欢迎交流