• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

fedora8 下mysql 安装的安装方法

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

我下载的是目前最新的版本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 stdout
Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysqld/mysqld.pid
071112 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 directory
071112 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 stdout
Starting mysqld daemon with databases from /var/lib/mysql

能正常启动

#bin/mysqladmin -u root password root

又出错

[root@localhost mysql]# bin/mysqladmin -u root password root
bin/mysqladmin: connect to server at 'localhost' failed
error: '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 -p
Enter 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 1
Server 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...


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Linux系统下Apache安装、配置、优化发布时间:2022-02-11
下一篇:
设置Linux系统文件权限发布时间:2022-02-11
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap