centos配置安装mysql-程序员做运维工作是如何被逐渐失态的

  • A+
所属分类:体育平台

耗时3天安装了一个mysql 记住这个逗比的教训

因项目部署需要在内网安装一个mysql,但服务器不能连网,也没有配置文件yum源,开始了我悲惨的运维生活

rpm安装mysql(失败)

下载Mysql-clinet*rpm/Mysql-server*.rpm/Mysql-devel*.rpm 并放置到同一个文件夹下

 rpm -ivh MySQL*.rpm

(其实如果只需要执行sql命令的话则只需要安装 server client devel 即可 )

提示缺少 perl-base -First Blood

下载perl-base 安装不上.... 与perl4重复/冲突 -Double kill

卸载 perl 4 安装了perl-base

sql安装异常 提示与 5.1冲突 -Triple kill

此时 执行了一个非常错误的操作 -ultra kill

运行了yum update 导致 操作系统由 centos 6.3升级成 centos 7.0 ..

降级失败 -Rampage

认命.....

centos配置安装mysql-程序员做运维工作是如何被逐渐失态的

重装系统再来!

1.centos配置yum源

因为无外网 所以配置了一个本地源 centos6.3 + centos 7.0 DVD.iso

a.映射iso文件

 mount -o loop -t iso9660 /root/CentOS-7.0-x86_64-bin-DVD1.iso /media/centos7

b.修改yum源(yum在重置时会自动地读取所有的后缀为repo(*.repo)文件)

/etc/yum.repos.d/local.repo

[local]
name=local
baseurl=file:///media/CentOS #文件夹位置
gpgcheck=1 #自动安装依赖 0 不自动安装
enabled=1
gpgkey=file:///media/CentOS/RPM-GPG-KEY-CentOS-7#key文件路径


c.刷新yum源

 yum clean all
 yum makecache


d.卸载5.1

e.安装 5.6正常

启动失败 提示缺少perl-CGI --Killing Spree

yum安装报冲突 异常 --Dominating

rpm强制安装成功

service mysql启动失败 --Mega-Kill

错误无法定位 --Unstoppable

各种安装错误后恼羞成怒

删除 mysql*

挂载 6.5yum源

删除perl*

删除 glibc*

删除 lib*

挂载 7.0yum源

yum install lib*

yum install glibc*

安装 MySQL-server-5.6.24-1.linux_glibc2.5.x86_64.rpm

rpm -ivh MySQL-server-5.6.24-1.linux_glibc2.5.x86_64.rpm

报错 文件冲突

经查询知晓 centos 7 默认的数据库为 MariaDB (mysql的一个分支)

卸载 MariaDB

yum remove MariaDB

重新安装成功

安装client成功


启动

得到错误:

ERROR!The server quit without updating PID file

错误日志:

 150623 11:00:34 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2015-06-23 11:00:35 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_t
imestamp server option (see documentation for more details).
2015-06-23 11:00:35 0 [Note] /usr/sbin/mysqld (mysqld 5.6.24) starting as process 2490 ...
2015-06-23 11:00:35 2490 [Note] Plugin 'FEDERATED' is disabled.
/usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist
2015-06-23 11:00:35 2490 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2015-06-23 11:00:35 2490 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-06-23 11:00:35 2490 [Note] InnoDB: The InnoDB memory heap is disabled
2015-06-23 11:00:35 2490 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-06-23 11:00:35 2490 [Note] InnoDB: Memory barrier is not used
2015-06-23 11:00:35 2490 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-06-23 11:00:35 2490 [Note] InnoDB: Using Linux native AIO
2015-06-23 11:00:35 2490 [Note] InnoDB: Not using CPU crc32 instructions
2015-06-23 11:00:35 2490 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-06-23 11:00:35 2490 [Note] InnoDB: Completed initialization of buffer pool
2015-06-23 11:00:35 2490 [Note] InnoDB: Highest supported file format is Barracuda.
2015-06-23 11:00:35 2490 [Note] InnoDB: 128 rollback segment(s) are active.
2015-06-23 11:00:35 2490 [Note] InnoDB: Waiting for purge to start
2015-06-23 11:00:35 2490 [Note] InnoDB: 5.6.24 started; log sequence number 1600617
2015-06-23 11:00:35 2490 [Note] Server hostname (bind-address): '*'; port: 3306
2015-06-23 11:00:35 2490 [Note] IPv6 is available.
2015-06-23 11:00:35 2490 [Note] - '::' resolves to '::';
2015-06-23 11:00:35 2490 [Note] Server socket created on IP: '::'.
2015-06-23 11:00:35 2490 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
150623 11:00:35 mysqld_safe mysqld from pid file /var/lib/mysql/tytx.localdomain.pid ended
150623 11:06:31 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql


仔细查看日志

犯了java错误信息的错 --M-m-m-m…Monster Kill

一直处理

2015-06-23 11:00:35 2490 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist


各种不能解决方式全部试验了一遍后宣告失败 --Godlike

逐渐暴躁扭曲,放假回家!!! --Holy Shit

//-----------------------------------我是失去理智后的分割线---------------------------------

放假结束

打工人 打工魂 打工人不解决问题不是人!

再观日志发现

2015-06-23 11:00:35 2490 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

这个错误信息

运行命令

 scripts/mysql_install_db --user=mysql --datadir=/data/mysql

问题解决

最重要的问题在于 不知道为什么有问题 然后也不知道为什么问题没有了


好久不执行sql命令行 基础的操作语句都忘了

show databases; --逗比*2

show tables; --逗比^N

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: