解决mysql安装mysqld doesn\'t exist or is not-凯发app官方网站

凯发app官方网站-凯发k8官网下载客户端中心 | | 凯发app官方网站-凯发k8官网下载客户端中心
  • 博客访问: 6315242
  • 博文数量: 162
  • 博客积分: 3600
  • 博客等级: 中校
  • 技术积分: 10366
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-19 11:23
个人简介

专注系统运维、网络架构,研究技术凯发app官方网站的解决方案,记录我的思想轨迹、工作学习、生活和关注的领域

文章分类
文章存档

2014年(2)

2013年(16)

2012年(27)

2011年(117)

相关博文
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·

分类: mysql/postgresql

2011-09-28 10:51:47

最近phpwind升级8.7后,经常出现宕机的现象,不是apache卡死,吃光内存机器重启,就是mysql数据库被锁,无奈!
多个原因,apache的版本过低,导致执行效率慢;另外数据库版本过低,查询语句多时,自动锁!网站几乎不能访问!另外就是程序可能也有点问题,测试页面可以正常访问!凯发app官方网站主页却不能打开!

把apache升级到2.2版本,程序转移到了另一台机器上,搭建lamp环境,用于编译php, 已经安装好了mysql!  试着运行,发现机器运行正常,无负载超高的现象,可是网站还是会卡,数据库还是会锁死!

联系到phpwind官方寻找凯发app官方网站的技术支持,的确有bug,官方同意帮我们解决!

我们也考虑到把数据版本也升级下,由于机器暂时紧缺,只能在程序上搭建,一条船上前线,哈哈!

采用二进制文件安装mysql

初始化正常,添加mysql服务,可是启动的时候出现问题了

[root@localhost scripts]# /usr/local/mysql5.0.45/bin/mysqld_safe --defaults-file=/etc/my.cnf  --user=mysql  &
[1] 31358
[root@localhost scripts]# the file /usr/local/mysql/bin/mysqld doesn't exist or is not executable
please do a cd to the mysql installation directory and restart
this script from there as follows:
./bin/mysqld_safe.
see http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more
information
\
[1]   exit 1                  /usr/local/mysql5.0.45/bin/mysqld_safe --defaults-file=/etc/my.cnf --user=mysql


查看了很多资料,最终还是官方的文档给力:

5. change location into the installation directory:

          shell> cd mysql

     you will find several files and subdirectories in the `mysql'
     directory. the most important for installation purposes are the
     `bin' and `scripts' subdirectories:

        * the `bin' directory contains client programs and the server.
          you should add the full pathname of this directory to your
          `path' environment variable so that your shell finds the mysql
          programs properly. see *note environment-variables::.

        * the `scripts' directory contains the `mysql_install_db'
          script used to initialize the `mysql' database containing the
          grant tables that store the server access permissions.

  6. ensure that the distribution contents are accessible to `mysql'.
     if you unpacked the distribution as `mysql', no further action is
     required. if you unpacked the distribution as `root', its contents
     will be owned by `root'. change its ownership to `mysql' by
     executing the following commands as `root' in the installation
     directory:

          shell> chown -r mysql .
          shell> chgrp -r mysql .

     the first command changes the owner attribute of the files to the
     `mysql' user. the second changes the group attribute to the
     `mysql' group.

  7. if you have not installed mysql before, you must create the mysql
     data directory and initialize the grant tables:

          shell> scripts/mysql_install_db --user=mysql

     if you run the command as `root', include the `--user' option as
     shown. if you run the command while logged in as that user, you
     can omit the `--user' option.

     the command should create the data directory and its contents with
     `mysql' as the owner.

     after creating or updating the grant tables, you need to restart
     the server manually.

  8. most of the mysql installation can be owned by `root' if you like.
     the exception is that the data directory must be owned by `mysql'.
     to accomplish this, run the following commands as `root' in the
     installation directory:

          shell> chown -r root .
          shell> chown -r mysql data

  9. if you want mysql to start automatically when you boot your
     machine, you can copy `support-files/mysql.server' to the location
     where your system has its startup files. more information can be
     found in the `support-files/mysql.server' script itself and in
     *note automatic-start::.


我之前执行的是   chown -r mysql:mysql  .

官方: shell> chown -r root .
           shell> chown -r mysql data

最后修正重启:
[root@localhost mysql5.0.45]# chown -r root .
[root@localhost mysql5.0.45]# chown -r mysql data
[root@localhost mysql5.0.45]# ./bin/mysqld_safe --user=mysql &
[1] 31480
[root@localhost mysql5.0.45]# starting mysqld daemon with databases from /mysqldata

关闭重启:
[root@localhost mysql5.0.45]# /usr/local/mysql5.0.45/bin/mysqladmin  -u root  shutdown
stopping server from pid file /mysqldata/localhost.localdomain.pid
110928 10:49:34  mysqld ended

[1]   done                    ./bin/mysqld_safe --user=mysql
[root@localhost mysql5.0.45]# ./bin/mysqld_safe --user=mysql &
[1] 31654
[root@localhost mysql5.0.45]# starting mysqld daemon with databases from /mysqldata

正常!ok

阅读(24006) | 评论(0) | 转发(4) |
给主人留下些什么吧!~~
")); function link(t){ var href= $(t).attr('href'); href ="?url=" encodeuricomponent(location.href); $(t).attr('href',href); //setcookie("returnouturl", location.href, 60, "/"); }
网站地图