参考:
http://www.linuxdiyf.com/viewarticle.php?id=65598
http://bestchenwu.iteye.com/blog/1166998
第一种安装方式:
安装MySQL后,需要初始化 授权表、启动服务器,并确保服务器工作正常。你还要让服务器随系统的启动和停止自动启动和停止。应当为授权表中的账户指定密码。在某些安装中,该程序自动运行。
1、添加mysql用户组以及用户
groupadd mysql
useradd -g mysql mysql
2、解压mysql 并制定安装目录
cd /root/software/
tar xvzf mysql-5.1.68.tar.gz
cd mysql-5.1.68
3、configure
第一次配置 configure
./configure --prefix=/usr/local/mysql/ --with-server-suffix=-unionread-edition --enable-assembler --enable-local-infile --enable-thread-safe-client --with-charset=utf8 --with-extra-charsets=gbk,gb2312,utf8,ascii --with-readline --with-ssl --with-embedded-server --with-pthread --with-mysqld-user=mysql --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-plugins=partition,innobase,innodb_plugin
报错:
checking for tgetent in -lncursesw... no
checking for tgetent in -lncurses... no
checking for tgetent in -lcurses... no
checking for tgetent in -ltermcap... no
checking for tgetent in -ltinfo... no
checking for termcap functions library... configure: error: No curses/termcap library found
问题:configure时遇到缺少ncurses依赖包
解决:
查看nucrses并安装ncurses依赖包
yum list|grep ncurses
yum -y install ncurses-devel
安装完成以后重新配置 configure
./configure --prefix=/usr/local/mysql/ --with-server-suffix=-unionread-edition --enable-assembler --enable-local-infile --enable-thread-safe-client --with-charset=utf8 --with-extra-charsets=gbk,gb2312,utf8,ascii --with-readline --with-ssl --with-embedded-server --with-pthread --with-mysqld-user=mysql --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-plugins=partition,innobase,innodb_plugin
Thank you for choosing MySQL! mysql安装的第一步成功
4、make && make install
报错:
make[1]: Entering directory `/root/software/mysql-5.1.68/mysys'
source='my_new.cc' object='my_new.o' libtool=no \
DEPDIR=.deps depmode=none /bin/sh ../depcomp \
g++ -DDEFAULT_BASEDIR=\"/home/mysql\" -DMYSQL_DATADIR="\"/home/mysql/var\"" -DDEFAULT_CHARSET_HOME="\"/home/mysql\"" -DSHAREDIR="\"/home/mysql/share/mysql\"" -DDEFAULT_HOME_ENV=MYSQL_HOME -DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX -DDEFAULT_SYSCONFDIR="\"/home/mysql/etc\"" -DHAVE_CONFIG_H -I. -I../include -I../include -I../include -I. -O -fno-implicit-templates -fno-exceptions -fno-rtti -c -o my_new.o my_new.cc
../depcomp: line 571: exec: g++: not found
make[1]: *** [my_new.o] Error 127
make[1]: Leaving directory `/root/software/mysql-5.1.68/mysys'
make: *** [all-recursive] Error 1
问题:g++ not found 。
对比查看发现GCC已经安装但缺少g++,所以make时报错。
安装gcc-c++
[root@open2 ~/software]# yum -y install gcc-c++
第三次 ./configure
./configure --prefix=/usr/local/mysql/ --with-server-suffix=-unionread-edition --enable-assembler --enable-local-infile --enable-thread-safe-client --with-charset=utf8 --with-extra-charsets=gbk,gb2312,utf8,ascii --with-readline --with-ssl --with-embedded-server --with-pthread --with-mysqld-user=mysql --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-plugins=partition,innobase,innodb_plugin
make && make install
漫长的等待。
5、初始化授权表:
/usr/local/mysql/bin/mysql_install_db --user=mysql --datadir=/var/lib/mysql/
copy配置文件:
cp /usr/local/mysql/share/my-medium.cnf /etc/my.cnf
6、启动mysql服务
/usr/local/mysql/bin/mysqld_safe &
设置启动服务
cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig --level 345 mysqld on
#复制mysql启动到用户path下
cp /usr/local/mysql/bin/mysql /usr/bin/mysql
#启动mysql
service mysqld start
键入mysql 或者 全路径 /usr/local/mysql/bin/mysql
可以登陆了。
7、修改root密码
/usr/local/mysql/bin/mysqladmin -uroot password XXXXXX
再次登陆
mysql -uroot -p
第二种方式 rpm安装包手动安装:
1)软件包:
MySQL-server-community-5.1.54-1.rhel5.x86_64.rpm
MySQL-client-community-5.1.54-1.rhel5.x86_64.rpm
2)安装命令:
rpm -ivh MySQL-server-community-5.1.54-1.rhel5.x86_64.rpm
rpm -ivh MySQL-client-community-5.1.54-1.rhel5.x86_64.rpm
执行安装时报错:
[root@open2 ~/software]# rpm -ivh MySQL-server-community-5.1.54-1.rhel5.x86_64.rpm
Preparing... ########################################### [100%]
file /usr/share/mysql/spanish/errmsg.sys from install of MySQL-server-community-5.1.54-1.rhel5.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
file /usr/share/mysql/swedish/errmsg.sys from install of MySQL-server-community-5.1.54-1.rhel5.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
file /usr/share/mysql/ukrainian/errmsg.sys from install of MySQL-server-community-5.1.54-1.rhel5.x86_64 conflicts with file from package mysql-libs-5.1.66-2.el6_3.x86_64
错误提示server与mysql-libs-5.1.66包冲突。
解决思路,先移除冲突的libs包,在进行安装
[root@open2 ~/software]# rpm -qa |grep mysql
mysql-libs-5.1.66-2.el6_3.x86_64
[root@open2 ~/software]# yum -y remove mysql-libs-5.1.66*
[root@open2 ~/software]# rpm -ivh MySQL-server-community-5.1.54-1.rhel5.x86_64.rpm
成功。
相关推荐
服务器环境 lix或者win随意 安装宝塔 安装apqche php5.4 mysql5.5 源码放至网站根目录 然后新建数据库 gm_un_pt导入gm_un_pt.sql 搜索 config 修改里面的数据库账号和密码 后台密码:admin后台地址:你的IP或者...
●Linux/centos 安装jdk 1.8 ,tomcat 8.5 ,mysql 5.7 ●tomcat 部署war包 注:war包放入tomcat/webapps目录,tomcat/bin 执行●命令startup.sh 开发教程 ●mysql,创建数据库,手工导入sql文件完成初始化。 ●...
(Torvalds@kruuna.helsinki.fi)写了 Linux核心程序的 0.02 版开始的,但其后的发展却几乎都 是由互联网上的 Linux社团(Linux Community)互通交流而完成的。Linux 不属于任何一 家公司或个人,任何人都可以免费取得...
Apache+SVN配置成功后可以有两种方式: 多库方式:SVNParentPath 指定一个父目录,所有仓库在这个父目录下,使用一个密码文件和一个权限配置文件。优点是增加删除仓库不需要改apache的httpd.conf,不需要重启Apache...
五、CacheCloud在搜狐的规模每天100 亿次命令调用2T 的内存空间800 个Redis实例100 台机器六、CacheCloud环境需求Java 7Maven 3MySQLRedis 3七、CacheCloud快速开始1、初始化数据库 导入项目中cachecloud.sql初始化...
安装ivy主要有两种方式,手工安装或者自动安装。 1) 手工安装 从这里下载你想要的版本,在任何你想的地方解开下载的zip文件,并复制ivy的jar文件到你的ant的lib目录(ANT_HOME/lib). 如果你使用ant 1.6.0或者更高,你...
第二套方案是使用JavaWeb平台,数据库工具使用MySQL,平台和数据库可以在Linux操 作系统下运行,Linux操作系统免费,JavaWeb和MySQL也都是免费的,不涉及到版权纠纷和 高昂的软件购置费用问题。 为了节约成本系统建设...
// 一个包含两个元素的数组 $a[0] = "first"; $a[1] = "second"; $a[] = "third"; // 添加数组元素的简单方法 // 现在$a[2]被赋值为"third" echo count($a); // 打印出3,因为该是...
1312 网吧维护\win2003系统自动登录的两种方法 .txt 2691 网吧维护\Windows XP 中实现目录共享.txt 2987 网吧维护\windows XP系统总命令集合.txt 2562 网吧维护\WINDOWS98安装参数详解.txt 11786 网吧维护\Windows...
(1) 技术可行性-----本系统仅需要一台装有 Windows/Linux 系统并装有 Mysql数据库和Tomcat服务器的计算机即可,对机器本身没有太高的要求,一般当前学校或个人电脑完全可满足要求。对于软件技术要求,现在的JAVA...