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

[经验分享] 在Centos 5.4上安装Mysql5.5.10 (整理以前的工作文档)

[复制链接]

尚未签到

发表于 2016-5-14 02:34:58 | 显示全部楼层 |阅读模式
1.安装环境
1.1.目的
  安装Mysql5.5.10服务,提供公司XXXX测试环境。正式环境也采用该版本的mysql
  
1.2. 硬件环境
  PC机:IntelE5300 内存4G 硬盘500G
  
1.3. 软件环境
  Mysql5.5.10
  cmake2.8.3
  
  

  
  
2.安装
2.1.安装cmake
  shell>tar zxvf cmake-2.8.3.tar.gz
  shell>cd cmake-2.8.3
  shell>./configure
  shell>make
  shell>make install
  
2.2.安装mysql
  shell>tar zxvf mysql-5.5.10.tar.gz
  shell>cd mysql-5.5.10
  shell>cmake . \
  -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/mysql \
  -DCOMMUNITY_BUILD:BOOL=ON \
  -DENABLED_PROFILING:BOOL=ON \
  -DENABLE_DEBUG_SYNC:BOOL=OFF \
  -DINSTALL_LAYOUT:STRING=STANDALONE \
  -DMYSQL_DATADIR:PATH=/usr/local/mysql/data \
  -DMYSQL_MAINTAINER_MODE:BOOL=OFF \
  -DWITH_EMBEDDED_SERVER:BOOL=ON \
  -DWITH_EXTRA_CHARSETS:STRING=all \
  -DWITH_SSL:STRING=bundled \
  -DWITH_UNIT_TESTS:BOOL=OFF \
  -DWITH_ZLIB:STRING=bundled \
  -DWITH_INNOBASE_STORAGE_ENGINE=1\
  -DWITH_COMMENT=dancebear \
  -DDEFAULT_CHARSET=utf8 \
  -DDEFAULT_COLLATION=utf8_general_ci \
  -LH
  shell>make && make install
  
  shell>groupadd mysql
  shell>useradd -g mysql mysql
  
  shell>mkdir /usr/local/mysql/conf
  shell>mkdir /usr/local/mysql/var
  shell>cd /usr/local/mysql
  shell>cp support-files/my-huge.cnf conf/my.cnf
  shell>chown -R root:mysql /usr/local/mysql
  shell>/usr/local/mysql/scripts/mysql_install_db--basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --skip-name-resolve--user=mysql --defaults-file=/usr/local/mysql/conf/my.cnf--pid-file=/usr/local/mysql/var/mysql.pid--socket=/usr/local/mysql/var/mysql.sock
  
  shell>ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql
  shell>ln -s /usr/local/mysql/bin/mysqladmin /usr/bin/
  shell>ln -s /usr/local/mysql/bin/mysqld_safe /usr/bin/
  shell>ln -s /usr/local/mysql/share/mysql/mysql.server/usr/bin/
  shell>ln -s /usr/local/mysql/bin/mysqldump /usr/bin/
3.安装后配置
3.1. 设置mysql自动启动脚本
  shell>cp /usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld
  shell>chmod 755 /etc/init.d/mysqld
  shell>chkconfig –-add mysqld
  shell>chkconfig –-level 345 mysqld on
  
  修改配置文件/etc/init.d/mysqld,添加安装mysql的路径
  basedir=/usr/local/mysql
  datadir=/usr/local/mysql/data
  可以使用以下命令启停mysql服务或查看当前mysql服务状态
  shell>/etc/init.d/mysqld start
  shell>/etc/init.d/mysqld stop
  shell>/etc/init.d/mysqld status
  
3.2.设置root密码
  [iyunv@ldap-mysql-svn-trac test]# mysqladmin-uroot password 'mysql'

  
3.3.错误解决
  110331 11:55:00 mysqld_safe Starting mysqld daemon with databasesfrom /usr/local/mysql/data
  /usr/local/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist
  110331 11:55:00 [ERROR] Can't open the mysql.plugin table. Pleaserun mysql_upgrade to create it.
  110331 11:55:00 InnoDB: The InnoDB memory heap is disabled
  110331 11:55:00 InnoDB: Mutexes and rw_locks use InnoDB's ownimplementation
  110331 11:55:00 InnoDB: Compressed tables use zlib 1.2.5
  110331 11:55:00 InnoDB: Initializing buffer pool, size = 128.0M
  110331 11:55:00 InnoDB: Completed initialization of buffer pool
  110331 11:55:00 InnoDB: highest supported file format is Barracuda.
  110331 11:55:00 InnoDB:Waiting for the background threads to start
  110331 11:55:01 InnoDB: 1.1.5 started; log sequence number 1595675
  110331 11:55:01 [ERROR] /usr/local/mysql/bin/mysqld: unknown option'--skip-locking'
  110331 11:55:01 [ERROR] Aborting
  
  110331 11:55:01 InnoDB:Starting shutdown...
  110331 11:55:02 InnoDB:Shutdown completed; log sequence number 1595675
  110331 11:55:02 [Note] /usr/local/mysql/bin/mysqld: Shutdowncomplete
  【解决方案】:
  
  [iyunv@ldap-mysql-svn-trac mysql]# scripts/mysql_install_db--user=mysql
  Installing MySQL system tables...
  110331 13:21:15 [ERROR] ./bin/mysqld: unknown option'--skip-locking'
  110331 13:21:15 [ERROR] Aborting
  
  110331 13:21:15 [Note] ./bin/mysqld: Shutdown complete
  
  
  Installation of system tables failed! Examine the logs in
  ./data for more information.
  
  You can try to start the mysqld daemon with:
  
   shell> ./bin/mysqld--skip-grant &
  
  and use the command line tool ./bin/mysql
  to connect to the mysql database and look at the grant tables:
  
   shell> ./bin/mysql-u root mysql
   mysql> show tables
  
  Try 'mysqld --help' if you have problems with paths. Using --log
  gives you a log in ./data that may be helpful.
  
  Please consult the MySQL manual section
  'Problems running mysql_install_db', and the manual section that
  describes problems on your OS.Another information source are the
  MySQL email archives available at http://lists.mysql.com/.
  
  Please check all of the above before mailing us! And remember, if
  you do mail us, you MUST use the ./bin/mysqlbug script!
  
  然后,servicemysqld start
  [iyunv@ldap-mysql-svn-tracmysql]# service mysqld start
  StartingMySQL.[ OK ]
  [iyunv@ldap-mysql-svn-tracmysql]#

运维网声明 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-216627-1-1.html 上篇帖子: CentOS 在同一窗口打开文件夹 下篇帖子: CentOS下MySQL最新版本5.6.13源码安装过程
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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

扫描微信二维码查看详情

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


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


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


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



合作伙伴: 青云cloud

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