在Linux上源码编译安装完mysql后,又将安装的路径进行了修改,但是发现在设置后环境变量后启动报错,如下:[root@www.linuxidc.com var]# mysqld_safe --user=mysql &[1] 31248[root@www.linuxidc.com var]# 110422 11:04:00 mysqld_safe Logging to "/opt/mysql5156/var/HServer_03.err".touch: cannot touch `/opt/mysql5156/var/HServer_03.err": No such file or directorychown: cannot access `/opt/mysql5156/var/HServer_03.err": No such file or directory110422 11:04:00 mysqld_safe The file /opt/mysql5156/libexec/mysqlddoes not exist or is not executable. Please cd to the mysql installationdirectory 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/usr/local/mysql/bin/mysqld_safe: line 100: /opt/mysql5156/var/HServer_03.err: No such file or directory[1]+ Exit 1 mysqld_safe --user=mysql按照提示原有的路径目录不存在,需要到mysql的相对路径下启动~我的原安装路径是在/opt/mysql5156下,具体的安装过程:Shell> tar –zxvvf mysql-5.1.56.tar.gzShell> cd mysql-5.1.56Shell> ./configure --prefix=/opt/mysql5156 --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=latin1,gb2312 --with-plugins=innobase,innodb_plugin,myisam,heap,csv,federated,blackhole --enable-local-infile --enable-thread-safe-clientShell> makeShell >make installShell> cp support-files/my-medium.cnf /etc/my.cnfShell>cd /opt/mysql5156Shell>chown –R mysql .Shell>chgrp –R mysql .Shell>bin/mysql_install_db –user=mysqlShell>chown –R root .Shell> chown –R mysql varShell>vi /root/.bash_profilePATH=$PATH:$HOME/bin:/opt/mysql5156/bin现在将/opt/mysql5156/目录移动到/usr/local/下:Shell>mv /opt/mysql5156 /usr/local/mysqlShell>vi /root/.bash_profilePATH=$PATH:$HOME/bin:/usr/local/mysql/binShell>source /root/.bash_profile在启动时出现上述错误的主要原因是mysql在编译安装时,将路径/opt/mysql5156写入了mysql/bin/mysqld_safe脚本中,打开该脚本可以明确看到各个启动逻辑的判断都有/opt/mysql5156的影子,那么将所有的/opt/mysql5156 全局替换为/usr/local/mysql,保存后重新启动,ok了。另外由于这次的编译安装时采用动态编译的,还需要修改mysql的动态函式库,Shell>vi /etc/ld.so.conf/usr/local/mysql/lib/mysql/Shell>ldconfig这样在新的路径下,编译安装的mysql就可以无碍使用了。简单的MySQL备份脚本MySQL DBA备份工具Xtrabackup使用指南相关资讯 MySQL教程
- 30分钟带你快速入门MySQL教程 (02月03日)
- MySQL教程:关于I/O内存方面的一些 (01月24日)
- CentOS上开启MySQL远程访问权限 (01/29/2013 10:58:40)
| - MySQL教程:关于checkpoint机制 (01月24日)
- MySQL::Sandbox (04/14/2013 08:03:38)
- 生产环境MySQL 5.5.x单机多实例配 (11/02/2012 21:02:36)
|
本文评论 查看全部评论 (0)