免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1265 | 回复: 0
打印 上一主题 下一主题

fedora8 mysql 安装 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-11-14 02:04 |只看该作者 |倒序浏览
  记得在fedora7 中按照mysql 的安装文档一步步来就行,可在fedora 8 中却出现了问题,经多方查找原因终于解决,庆祝一下。
  我下载的是目前最新的版本mysql-5.0.45-linux-i686.tar.gz
  安装过程:
    su 到root 权限。
  #tar -zvxf mysql-5.0.45-linux-i686.tar.gz
  #mv mysql-5.0.45/ /usr/local/mysql
  #cd /usr/local/mysql
  #groupadd mysql
  #useradd -g mysql mysql
  #chown -R mysql .
  #chgrp -R mysql .
  #scripts/mysql_install_db --user=mysql
  #chown -R root .
  #chown -R mysql data
  #bin/mysqld_safe --user=mysql &
  按照官方文档说这就应该能启动了,可是报错如下:
  
   
nohup: ignoring input and redirecting stderr to stdoutStarting mysqld daemon with databases from /var/lib/mysqlSTOPPING server from pid file /var/run/mysqld/mysqld.pid071112 00:22:06  mysqld ended
查看日志:
#less /var/log/mysqld.log
其中有一段如下:
071112  0:22:06 [ERROR] /usr/local/mysql/bin/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 2)071112  0:22:06 [ERROR] Can't start server: can't create PID file: No such file or directory071112 00:22:06  mysqld ended
#cd /var/run/
#ls
mysqld目录不存在
#mkdir /var/run/mysqld
#cd /var/run/mysqld
创建文件mysqld.pid
#touch mysqld.pid
#cd..
#chown -R mysql mysqld .
#cd /usr/local/mysql/
#bin/mysqld_safe --user=mysql &
nohup: ignoring input and redirecting stderr to stdoutStarting mysqld daemon with databases from /var/lib/mysql
能正常启动
#bin/mysqladmin -u root password root
又出错
[root@localhost mysql]# bin/mysqladmin -u root password rootbin/mysqladmin: connect to server at 'localhost' failederror: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists![root@localhost mysql]# bin/mysql -u root -pEnter password:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
分析:是/tmp/mysql.sock 不存在
# cd /var/lib/mysql/
ibdata1      ib_logfile0  ib_logfile1  mysql/       mysql.sock   test/
由于mysql 默认的mysql.sock 是在/var/lib/mysql/mysql.sock,
创建符号连接:
# ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
# bin/mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 1Server version: 5.0.45 MySQL Community Server (GPL)Type 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql>
修改root 密码
#cd /usr/local/mysql/
#bin/mysqladmin -u root -p password yourpassword
一切ok.
一切ok...
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/35069/showart_421735.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP