CentOS下使用rpm包安装MySQL

php中文网
发布: 2016-06-07 16:08:03
原创
1306人浏览过

CentOS下安装MySQL步骤: 第一、 http://www.mysql.com/downloads/mysql-4.0.html下载MySQL-client-5.0.96-1.glibc23.x86_64.rpm

centos下安装mysql步骤:

第一、 下载MySQL-client-5.0.96-1.glibc23.x86_64.rpm和

MySQL-server-5.0.96-1.glibc23.x86_64.rpm

第二、安装服务端:

[root@linuxidc mysql]# rpm -ivh MySQL-server-5.1.73-1.glibc23.i386.rpm

          显示信息:


Preparing...                ########################################### [100%]
    1:MySQL-server          ########################################### [100%]
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
。。。。。
Please report any problems with the /usr/bin/mysqlbug script!

如出现如上信息,,则表示服务器端安装成功。

安装客户端:[root@linuxidc mysql]# rpm -ivh MySQL-client-5.1.73-1.glibc23.i386.rpm

显示如下信息则表明安装成功:

Preparing...                ########################################### [100%]
    1:MySQL-client          ########################################### [100%]

若安装过程中报该错误!!!

file /usr/share/mysql/czech/errmsg.sys from install of MySQL-server-5.1.73-1.glibc.i386 conflicts with file from package mysql-libs-5.1.73-1.glibc.i386

原因:已存在mysql-libs-5.1.73-1.glibc.i386的库(这是linux自带的)所以需要先删除以前的库才能安装

rpm -e mysql-libs-5.1.73-1.glibc.i386 --nodeps 强制卸载!

第三、启动mysql服务

[root@linuxidc sean]# /etc/init.d/mysql start 或者

[root@linuxidc sean]# mysqld_safe &

通过netstat命令查看mysql是否启动成功

[sean@linuxidc ~]$ netstat -nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address              Foreign Address            State     
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                  LISTEN     
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                  LISTEN     
tcp        0      0 127.0.0.1:631              0.0.0.0:*                  LISTEN     
tcp        0      0 127.0.0.1:6010              0.0.0.0:*                  LISTEN     
tcp        0    52 192.168.1.128:22            192.168.1.106:51488        ESTABLISHED
tcp        1      0 192.168.1.128:38414        23.2.16.57:80              CLOSE_WAIT 
tcp        0      0 :::22                      :::*                        LISTEN     
tcp        0      0 ::1:631                    :::*                        LISTEN     
tcp        0      0 ::1:6010                    :::*                        LISTEN

mysql默认端口号为3306,以上信息中出现3306端口号,则启动成功

95Shop仿醉品商城
95Shop仿醉品商城

95Shop可以免费下载使用,是一款仿醉品商城网店系统,内置SEO优化,具有模块丰富、管理简洁直观,操作易用等特点,系统功能完整,运行速度较快,采用ASP.NET(C#)技术开发,配合SQL Serve2000数据库存储数据,运行环境为微软ASP.NET 2.0。95Shop官方网站定期开发新功能和维护升级。可以放心使用! 安装运行方法 1、下载软件压缩包; 2、将下载的软件压缩包解压缩,得到we

95Shop仿醉品商城 0
查看详情 95Shop仿醉品商城

查看mysql进程:

[root@linuxidc sean]# ps -e

第四、停止mysql服务:

[root@linuxidc sean]# /usr/bin/mysqladmin -u root -p shutdown

重启mysql服务:/etc/init.d/mysql restart

第五、重启linux之后,启动mysql服务

[root@linuxidc sean]# /usr/init.d/mysql start

[root@linuxidc mysql]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.73 MySQL Community Server (GPL)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

退出mysql:

mysql> exit

设置mysql密码

[root@linuxidc mysql]# /usr/bin/mysqladmin -u root password '*****'

登录mysql

[root@linuxidc mysql]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.73 MySQL Community Server (GPL)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

出现以上信息表明登录成功!!!

第六、卸载mysql

用rpm包卸载:

[root@linuxidc sean]# rpm -qa|grep MySQL
MySQL-client-5.1.73-1.glibc23.i386
MySQL-server-5.1.73-1.glibc23.i386

执行此命令卸载 [root@linuxidc sean]# rpm -e --nodeps MySQL-client-5.1.73-1.glibc23.i386 

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号