关闭 x
IT技术网
    技 采 号
    ITJS.cn - 技术改变世界
    • 实用工具
    • 菜鸟教程
    IT采购网 中国存储网 科技号 CIO智库

    IT技术网

    IT采购网
    • 首页
    • 行业资讯
    • 系统运维
      • 操作系统
        • Windows
        • Linux
        • Mac OS
      • 数据库
        • MySQL
        • Oracle
        • SQL Server
      • 网站建设
    • 人工智能
    • 半导体芯片
    • 笔记本电脑
    • 智能手机
    • 智能汽车
    • 编程语言
    IT技术网 - ITJS.CN
    首页 » MySQL »MySQL SUSE SLES11安装与配置笔记实操

    MySQL SUSE SLES11安装与配置笔记实操

    2010-05-12 10:06:00 出处:ITJS
    分享

    以下的文章主要介绍的是MySQL SUSE SLES11安装与配置笔记的实际操作过程,我们是在Linux下两个不同的版本MySQL安装实战(MySQL5和MySQL4)演示,以下就是文章的而具体内容描述。

    Redhat9.2 安装MySQL5.0

    fedora7安装MySQL

    (1) 下载

    从MySQL官网 下载到最新的发行版本5.1.45,简单起见,直接下载SLES11的RPM版本:

    MySQL-server-community-5.1.45-1.sles11.i586.rpm  MySQL-client-community-5.1.45-1.sles11.i586.rpm  MySQL-shared-community-5.1.45-1.sles11.i586.rpm 

    对MySQL版本的选择,个人意见,如果是作为产品首先考虑稳定性和性能,功能够用即可,版本上谨慎保守一些,但是作为一般开发用用,追追新也无所谓。

    (2) MySQL SUSE SLES11 安装

    1. rpm安装

    执行:rpm -ivh MySQL-server-community-5.1.45-1.sles11.i586.rpm  Preparing... ########################################### [100%]  1:MySQL-server-community ########################################### [100%]  MySQL 0:off 1:off 2:on 3:on 4:on 5:on 6:off  PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !  To do so, start the server, then issue the following commands:  /usr/bin/MySQLadmin -u root password 'new-password'  /usr/bin/MySQLadmin -u root -h ss-server password 'new-password'  Alternatively you can run:  /usr/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.  Please report any problems with the /usr/bin/MySQLbug script!  Starting MySQL. done  Giving MySQLd 2 seconds to start   

    使用ps -ef | grep MySQL 看到的是msyqld进行已经启动。netstat -nat 看到的是默认的3306端口已经在监听。rpm的安装的确是够简单。

    tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN

    但是这样的默认安装,是没有指定安装路径的,因此MySQL不会MySQL SUSE SLES11 安装到我们期望的地点。因此只好重新来过,先卸载吧:

    rpm -e MySQL-server-community-5.1.45-1.sles11

    使用--prefix选项重新安装:

    rpm -ivh --prefix=/work/soft/database/MySQL/ MySQL-server-community-5.1.45-1.sles11.i586.rpm

    结果发生错误:

    error: package MySQL-server-community is not relocatable  

    居然不能重新定位MySQL SUSE SLES11 安装路径,这个就麻烦了。只好重新下载tarbell的版本MySQL-5.1.45.tar.gz,自己动手编译。

    2. 编译

    ./configure --prefix=/work/soft/database/MySQL/MySQL5.1 --localstatedir=/work/soft/database/MySQL/MySQLdata --with-charset=utf8 --with-extra-charsets=all --with-client-ldflags=-all-static --with-MySQLd-ldflags=-all-static --with-unix-socket-path=/work/soft/database/MySQL/tmp/MySQL.sock

    configure的过程中出现错误而中断:

    checking for termcap functions library... configure: error: No curses/termcap library found 

    先把这个东西装好

    gunzip ncurses-5.7.tar.gz  tar xvf ncurses-5.7.tar  cd ncurses-5.7/  ./configure  make  make install 

    安装ncurses之后,重新configure成功,继续make,make install完成编译MySQL SUSE SLES11 安装。

    然后执行scripts/MySQL_install_db.

    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:  /work/soft/database/MySQL/MySQL5.1/bin/MySQLadmin -u root password 'new-password'  /work/soft/database/MySQL/MySQL5.1/bin/MySQLadmin -u root -h ss-server password 'new-password'  Alternatively you can run:  /work/soft/database/MySQL/MySQL5.1/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 /work/soft/database/MySQL/MySQL5.1 ; /work/soft/database/MySQL/MySQL5.1/bin/MySQLd_safe &  You can test the MySQL daemon with MySQL-test-run.pl  cd /work/soft/database/MySQL/MySQL5.1/MySQL-test ; perl MySQL-test-run.pl  Please report any problems with the /work/soft/database/MySQL/MySQL5.1/bin/MySQLbug script!   

    接着很重要的事情,设置MySQLd的开机启动:

    cp support-files/MySQL.server /etc/init.d/MySQL  chkconfig MySQL on  

    为了方便,将MySQL 的bin目录加到PATH中,在/etc/profile中加入myslq/bin,顺便增加两个别名方便操作:

    export PATH=$JAVA_HOME/bin:$SOFT_ROOT/database/MySQL/MySQL5.1/bin:$PATH  alias MySQL_start="MySQLd_safe&" alias MySQL_stop="MySQLadmin -uroot -p shutdown" 

    3. 配置

    按照普遍推荐的标准设置,需要增加MySQL的user和group:不过上面的MySQL SUSE SLES11 安装过程结束后,发现已经存在名为MySQL的user和group了:

    ss-server:/etc # groupadd MySQL  groupadd: Group `MySQL' already exists.  ss-server:/etc # useradd MySQL -g MySQL  useradd: Account `MySQL' already exists.  

    用ps命令看到的是

    ss-server:/etc # ps -ef | grep MySQL  root 3743 1 0 18:58   00:00:00 /bin/sh 

    上一篇返回首页 下一篇

    声明: 此文观点不代表本站立场;转载务必保留本文链接;版权疑问请联系我们。

    别人在看

    Edge浏览器百度被劫持/篡改怎么办,地址后边跟着尾巴#tn=68018901_7_oem_dg

    Google Chrome 在 iPhone 上新增了 Safari 数据导入选项

    Windows 11专业版 KMS工具激活产品密钥的方法

    DEDECMS安全策略官方出品

    Microsoft Text Input Application 可以关闭吗?

    新版本QQ如何关闭自带的浏览器?

    C++编程语言中continue的用法和功能,附举例示范代码

    c++ map 的数据结构、基本操作以及其在实际应用中的使用。

    C语言如何避免内存泄漏、缓冲区溢出、空指针解引用等常见的安全问题

    C语言中的break语句详解

    IT头条

    马斯克2026最新采访总结:2040年,全球机器人数量将突破100亿台

    23:52

    专家解读|规范人工智能前沿业态健康发展的新探索:解读《人工智能拟人化互动服务管理暂行办法》

    00:54

    用至强 6高存力搞定MoE卸载!

    17:53

    美国将允许英伟达向中国“经批准的客户”出售H200 GPU

    02:08

    苹果与微信就15%手续费达成一致?腾讯未置可否

    22:00

    技术热点

    PHP 和 Node.js 的10项对比挑战

    Javascript闭包深入解析及实现方法

    windows 7、windows 8.1手动增加右键菜单功能技巧

    MYSQL出错代码大汇总

    windows 7假死机怎么办 windows 7系统假死机的原因以及解决方法

    Ubuntu(Linux)下配置IP地址的方法

      友情链接:
    • IT采购网
    • 科技号
    • 中国存储网
    • 存储网
    • 半导体联盟
    • 医疗软件网
    • 软件中国
    • ITbrand
    • 采购中国
    • CIO智库
    • 考研题库
    • 法务网
    • AI工具网
    • 电子芯片网
    • 安全库
    • 隐私保护
    • 版权申明
    • 联系我们
    IT技术网 版权所有 © 2020-2025,京ICP备14047533号-20,Power by OK设计网

    在上方输入关键词后,回车键 开始搜索。Esc键 取消该搜索窗口。