下载mysql
http://pan.baidu.com/s/1dDu6n9R
查看本机mariadb相关文件
rpm -qa | grep mariadb
全部用类似下面的命令进行铲除
rpm -e --nodeps mariadb-libs-5.5.35-3.el7.x86_64
然后安装,(文件名以你下载的为准)
rpm -ivh MySQL-client-advanced-5.6.22-1.el7.x86_64.rpm
rpm -ivh MySQL-devel-advanced-5.6.22-1.el7.x86_64.rpm
rpm -ivh MySQL-server-advanced-5.6.22-1.el7.x86_64.rpm
启动mysql命令:
service mysql start
报错:
[ Warning ] TIMESTAMP with implicit DEFAULT value is deprecated . Please use --explicit_defaults_for_timestamp server option (see documentation for more details). [ Warning ] Buffered warning : Changed limits : max_open_files : 1024 ( requested 5000 )[Warning] Buffered warning: Changed limits: table_cache: 431 (requested 2000) [Note] Plugin 'FEDERATED' is disabled. [Note] InnoDB: Using atomics to ref count buffer pool pages [Note] InnoDB: The InnoDB memory heap is disabled [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins [Note] InnoDB: Memory barrier is not used [Note] InnoDB: Compressed tables use zlib 1.2.3 [Note] InnoDB: Using Linux native AIO [Note] InnoDB: Using CPU crc32 instructions [Note] InnoDB: Initializing buffer pool, size = 128.0M [Note] InnoDB: Completed initialization of buffer pool InnoDB: Error: pthread_create returned 13 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended据说的问题1:打开文件数不足修改下面的文件
vi /etc/security/limits.conf
好吧:chmod -R 755/var/lib/mysql
输入mysql --help|grep my.cnf,查看到文件可能存在的位置,好吧一个都没有
据说应该mysql/my-medium.cnf里面复制一个出来,然后网上找了一个开始到路径里面乱改起来
据说的问题4:selinux问题,
打开/etc/selinux/config,把SELINUX=enforcing改为SELINUX=disabled后存盘退出重启机器。
我都不知道重启多少次了,setenforce 0 命令可以直接设置,太好了。
终于可以启动了。
然后又是root密码不知道的问题
关闭mysql 输入:
mysqld_safe --skip-grant-tables &
然后可以用mysql -uroot登录了
然后
use mysql;
UPDATE user SET Password=PASSWORD('111111') where USER='root';
终于把该死的mysql弄好了
最后
service mysql start