设为首页 收藏本站
查看: 429|回复: 0

[经验分享] mysql单实例安装配置指南

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-1-9 09:54:53 | 显示全部楼层 |阅读模式
1.操作系统:CentOS
2.数据库: mysql-5.1.73.tar.gz
3.任务:单实例安装配置指南
提示:下载数据库有两种方式:一种是官网,另一种途径是国内镜象网站;国内镜象下载资源的速度比官网要快,例如,我们这次下载的就是国内搜狐镜象:
http://mirrors.sohu.com/mysql/MySQL-5.1/
http://mirrors.sohu.com/
整个安装过程:
[iyunv@localhost tools]#wget http://mirrors.sohu.com/mysql/MySQL-5.1/mysql-5.1.73.tar.gz
[iyunv@localhost tools]# tar zxf mysql-5.1.73.tar.gz
[root@localhostmysql-5.1.73]# ./configure \
>--prefix=/usr/local/mysql \   #设定mysql安装路径,默认为/usr/local
>--with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock \  #指定mysql socket文件存放目录
>--localstatedir=/usr/local/mysql/data \  #设定mysql的文件存放位置
>--enable-assembler \  #充许使用汇编模式(优化性能)
>--enable-thread-safe-client \   #服务器
>--with-mysqld-user-user=mysql \
>--with-big-tables \
>--without-debug \   #使用非debug模式
>--with-pthread \   #强制使用pthread线程序库编译
>--enable-assembler \
>--with-extra-charsets=complex \
>--with-readline \
>--with-ssl \
>--with-embedded-server \
>--enable-local-infile \
>--with-plugins=partition,innobase \
>--with-plugin-PLUGIN \
>--with-mysqld-ldflags=-all-static \  #服务器使用静态库(优化性能)
>--with-client-ldflags=-all-static   #客户端使用静态库
#安装过程中报了一些错误
……………………………………………………………………..
checkingfor int8... no
checkingfor uint8... no
checkingfor int16... no
checkingfor uint16... no
checkingfor int32... no
checkingfor uint32... no
checkingfor int64... no
checkingfor uint64... no
checkingfor uchar... no
checkingcurses.h usability... no
checkingcurses.h presence... no
checkingfor curses.h... no
checkingtermcap.h usability... no
checkingtermcap.h presence... no
checkingfor termcap.h... no
checkingfor tgetent in -lncursesw... no
checkingfor tgetent in -lncurses... no
checkingfor tgetent in -lcurses... no
checkingfor tgetent in -ltermcap... no
checkingfor tgetent in -ltinfo... no
checkingfor termcap functions library... configure: error: No curses/termcap libraryfound
………………………………………………………….
# 解决以上方式(CentOS)的错误:
[iyunv@localhosttools]#  yum -y install ncurses-devel
[iyunv@localhosttools]# yum install gcc gcc-c++
#接下来重新配置环境;
[root@localhostmysql-5.1.73]# ./configure \
[root@localhostmysql-5.1.73]# make   #编译
[root@localhostmysql-5.1.73]#make install  #执行
#安装完成之后,就要检查安装是否成功!

[iyunv@localhostmysql]# netstat -lnt|grep 3306  #检查3306端口是否开启了
tcp      0    0 0.0.0.0:3306       0.0.0.0:*     LISTEN      
root@localhostmysql]# mysql -u root -p
Enterpassword:
ERROR1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
#登录不了的解决办法如下:
[iyunv@localhost~]#sudo /etc/init.d/mysqld stop
[iyunv@localhost~]#mysqld_safe --skip-grant-tables&
[iyunv@localhost~]# mysql -u root mysql
mysql>update user set password=PASSWORD("设置新密码") where user='root';
mysql>flush privileges;  //刷新系统权限表,立即生效
补充:
[iyunv@localhost tools]# rz  #结合secureCRT工具,通过rz命令,把资源上传到服务器上也可以
[iyunv@localhost tools]# yum install lrzsz -y  #没有安装,通过该yum源安装


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-40444-1-1.html 上篇帖子: mysql主从及amoeba读写分离 下篇帖子: 源码编译安装 MySQL 5.5.x 实践 mysql
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表