您好,欢迎访问一九零五行业门户网

Ubuntu 10.10里下载MySQL源码及编译安装

第一次在linux(ubuntu 10.10)上安装mysql,还是费了一些周折,总算基本理清思路了。先说说我最终成功安装的步骤,即在ubuntu 10
第一次在linux(ubuntu 10.10)上安装mysql,还是费了一些周折,总算基本理清思路了。先说说我最终成功安装的步骤,即在ubuntu 10.10里下载mysql源码,编译安装。
当前mysql版本是5.5.20,我的系统版本是ubuntu 10.10
1下载源码:
在官方网站,
选择:mysql community server--download
选择 sourcecode,前面几个都是什么rpm,最后一个是我觉得应该下载的包
download
(mysql-5.5.20.tar.gz)
2下载完成,解压缩。
里面有个安装说明文件:install-source
打开,里面这一段是核心安装步骤:(命令前都加sudo执行!)
# preconfiguration setup     首先是添加一个用户组
shell> groupadd mysql
shell> useradd -r -g mysql mysql
# beginning of source-build specific instructions
shell> tar zxvf mysql-version.tar.gz         解压缩源码包
shell> cd mysql-version                          切换到源码包目录
shell> cmake .                                            执行cmake,产生mk文件(没有cmake,,sudo apt-get install cmake)
shell> make                                                 编辑
shell> make install                                       安装
# end of source-build specific instructions             -----------ok,安装完成了哦
# postinstallation setup                                ----下面是配置mysql
shell> cd /usr/local/mysql
shell> chown -r mysql .
shell> chgrp -r mysql .
shell> scripts/mysql_install_db --user=mysql     ---执行内部mysql安装(参看红线下方执行结果)
shell> chown -r root .
shell> chown -r mysql data
# next command is optional                           --字面意思:下面这个命令可选
shell> cp support-files/my-medium.cnf /etc/my.cnf    复制mysql配置文件
shell> bin/mysqld_safe --user=mysql &                启动数据库
# next command is optional                          --字面意思:下面这个命令可选
shell> cp support-files/mysql.server /etc/init.d/mysql.server   设置自启动
按照这个就能完整安装了
3安装完并且配置完,进去看一下
在/usr/local/mysql 目录,执行
root@  -laptop:/usr/local/mysql#  ./bin/mysql -u root -s /tmp/mysql.sock -p
正常登录,提示:
oracle is a registered trademark of oracle corporation and/or its   affiliates. other names may be trademarks of their respective   owners.         mysql>  4官方网站有个gui工具,可以下载试一下:
mysql workbench (gui tool)
其它类似信息

推荐信息