db / 未分类 · 2016年8月25日

mysql5.6 rpm 打包过程和错误记录

ip 192.168.1.116
root
12345678
ps:
my.cnf
# by evan
log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
binlog_ignore_db = include_database_name

一开始打包编译不过是因为 我以前在打包5.5 时加了
# by evan 20180824pm
#CFLAGS=”-O3 -g -fno-exceptions -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing”
#CXX=g++
#CXXFLAGS=”-O3 -g -fno-exceptions -fno-rtti -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing”
#export CFLAGS CXX CXXFLAGS
[root@localhost ~]# rpm -ivh dkm_mysql-5.6.32-1.0.x86_64.rpm
Preparing… ########################################### [100%]
1:dkm_mysql ########################################### [100%]
cp: 无法获取”/data/apps/mysql/support-files/mysql.server” 的文件状态(stat): 没有那个文件或目录
chmod: 无法访问”/etc/rc.d/init.d/mysqld”: 没有那个文件或目录
在 mysqld 服务中读取信息时出错:没有那个文件或目录
/var/tmp/rpm-tmp.621ZR9: line 19: /etc/init.d/mysqld: 没有那个文件或目录
/var/tmp/rpm-tmp.621ZR9: line 20: /data/apps/mysql/bin/mysqladmin: 没有那个文件或目录
no crontab for root
[root@localhost bin]# 160825 09:54:18 mysqld_safe Logging to ‘/data/logs/mysql/mysqld-error.log’.
touch: 无法创建”/data/logs/mysql/mysqld-error.log”: 没有那个文件或目录
chmod: 无法访问”/data/logs/mysql/mysqld-error.log”: 没有那个文件或目录
touch: 无法创建”/data/logs/mysql/mysqld-error.log”: 没有那个文件或目录
chown: 无法访问”/data/logs/mysql/mysqld-error.log”: 没有那个文件或目录
160825 09:54:18 mysqld_safe Starting mysqld daemon with databases from /data/mysql/
./mysqld_safe: line 129: /data/logs/mysql/mysqld-error.log: 没有那个文件或目录
./mysqld_safe: line 166: /data/logs/mysql/mysqld-error.log: 没有那个文件或目录
touch: 无法创建”/data/logs/mysql/mysqld-error.log”: 没有那个文件或目录
chown: 无法访问”/data/logs/mysql/mysqld-error.log”: 没有那个文件或目录
chmod: 无法访问”/data/logs/mysql/mysqld-error.log”: 没有那个文件或目录
160825 09:54:18 mysqld_safe mysqld from pid file /data/mysql//localhost.localdomain.pid ended
./mysqld_safe: line 129: /data/logs/mysql/mysqld-error.log: 没有那个文件或目录
[1]+ Exit 1 ./mysqld_safe
[root@localhost ~]# rpm -ivh dkm_mysql-5.6.32-1.0.x86_64.rpm
Preparing… ########################################### [100%]
chown: 无法访问”/data/logs/”: 没有那个文件或目录
error: %pre(dkm_mysql-5.6.32-1.0.x86_64) scriptlet failed, exit status 1
error: install: %pre scriptlet failed (2), skipping dkm_mysql-5.6.32-1.0
打包错误
warning: Could not canonicalize hostname: dkm-lnmp-test
安装错误
[root@localhost ~]# rpm -ivh dkm_mysql-5.6.32-1.0.x86_64.rpm
Preparing… ########################################### [100%]
1:dkm_mysql ########################################### [100%]
Starting MySQL… ERROR! The server quit without updating PID file (/data/mysql//localhost.localdomain.pid).
/data/apps/mysql/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!
上面的错误 搞了哥两天呀
原因
打包成功mysql 5.6 一开始是参数 搞错 还有就是 /da/app/mysql 里面有 my.cnf
解决办法
1.打包( 安装)时指定了my.cnf (-DSYSCONFDIR=/etc) # 我采取了这种办法
2./da/app/mysql 里面有 my.cnf
重新配置vi /etc/my.cnf 加入
别人的说的办法
#在[mysqld]中添加:
datadir = /usr/local/mysql/data
log-error = /usr/local/mysql/data/error.log
pid-file = /usr/local/mysql/data/mysql.pid
user = mysql
tmpdir = /tmp
#保存退出
#初始化数据库
./mysql_install_db –user=mysql –basedir=/usr/local/mysql –datadir=/usr/local/mysql/data –pid-file=/usr/local/mysql/data/mysql.pid –tmpdir=/tmp