首页 技术 正文
技术 2022年11月19日
0 收藏 988 点赞 2,823 浏览 3511 个字

今天,在一台旧机器上编译一个新的Mysql,install时出了错:

/usr/local/mysql_5615/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql_5615/ --datadir=/mnt/disk1/mysql_5615/ Installing MySQL system tables...-- ::  [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
-- :: 7fb9ca4d06f0 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
-- :: 7fb9ca4d06f0 InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!
-- :: [Note] InnoDB: The InnoDB memory heap is disabled
-- :: [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
-- :: [Note] InnoDB: Compressed tables use zlib 1.2.
-- :: [Note] InnoDB: Using CPU crc32 instructions
-- :: [Note] InnoDB: Initializing buffer pool, size = 16.0M
-- :: [Note] InnoDB: Completed initialization of buffer pool
-- :: [ERROR] InnoDB: Unable to lock /usr/local/mysql/var/ibdata1, error:
-- :: [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
-- :: [Note] InnoDB: Retrying to lock the first data file
-- :: [ERROR] InnoDB: Unable to lock /usr/local/mysql/var/ibdata1, error:
-- :: [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.循环打印此错N次……-- :: [ERROR] InnoDB: Unable to lock /usr/local/mysql/var/ibdata1, error:
-- :: [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
-- :: [ERROR] InnoDB: Unable to lock /usr/local/mysql/var/ibdata1, error:
-- :: [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2014-01-20 17:01:02 30853 [ERROR] InnoDB: Unable to lock /usr/local/mysql/var/ibdata1, error: 11
2014-01-20 17:01:02 30853 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
-- :: [Note] InnoDB: Unable to open the first data file
-- :: 7fb9ca4d06f0 InnoDB: Operating system error number in a file operation.
InnoDB: Error number means 'Resource temporarily unavailable'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html
-- :: [ERROR] InnoDB: Can't open '/usr/local/mysql/var/ibdata1'
-- :: [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
-- :: [ERROR] Plugin 'InnoDB' init function returned error.
-- :: [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
-- :: [ERROR] Unknown/unsupported storage engine: InnoDB
-- :: [ERROR] Aborting

它试图去lock /usr/local/mysql/var/ibdata1,这并不是我想要的行为。我指定的basedir=/usr/local/mysql_5615,datadir=/mnt/disk1/mysql_5615,想来想去也不明白。可是怎么找到/usr/local/mysql/var/ibdata1来的呢?我查了查,服务器上的确有一个mysqld已经在跑了,而且用的就是这个数据文件。我的正确解决办法总不能是把人家的干掉啊。读了读mysql_install_db脚本,有些难懂,一下子也理解不出它为什么指定了这个目录。后来想到它应该是找到了某些我不想要的my.cnf文件。

于是查查:

/usr/local/mysql_5615/bin/mysqld --verbose --help | grep -A  'Default options'
-- :: [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /mnt/disk1/mysql_5615/my.cnf ~/.my.cnf
-- :: [ERROR] Aborting-- :: [Note] Binlog end

再ls一下这四个my.cnf,果然发现/etc/my.cnf是存在的。看看内容,正是正在运行的那个mysqld用的。把它暂时改名,再来mysql_install_db ,成功了。 回头要细读一下mysql_install_db 脚本了。

另:我还是喜欢什么东西都清清楚楚的。my.cnf还是喜欢放在自己的默认位置,这种用系统默认目录的,总是不喜欢。不过服务器也不是我的,不理了……

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,965
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,486
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,331
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,114
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,747
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,781