免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1491 | 回复: 0

解决mysql安装mysqld doesn\'t exist or is not [复制链接]

论坛徽章:
0
发表于 2011-12-23 01:23 |显示全部楼层
最近phpwind升级8.7后,经常出现宕机的现象,不是Apache卡死,吃光内存机器重启,就是mysql数据库被锁,无奈!
多个原因,apache的版本过低,导致执行效率慢;另外数据库版本过低,查询语句多时,自动锁!网站几乎不能访问!另外就是程序可能也有点问题,测试页面可以正常访问!主页却不能打开!

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

联系到phpwind官方寻找技术支持,的确有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

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

SACC2019中国系统架构师大会

【数字转型 架构演进】SACC2019中国系统架构师大会,8.5折限时优惠重磅来袭!
2019年10月31日~11月2日第11届中国系统架构师大会(SACC2019)将在北京隆重召开。四大主线并行的演讲模式,1个主会场、20个技术专场、超千人参与的会议规模,100+来自互联网、金融、制造业、电商等领域的嘉宾阵容,将为广大参会者提供一场最具价值的技术交流盛会。

限时8.5折扣期:2019年9月30日前


----------------------------------------

大会官网>>
  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP