千万个美丽的未来,抵不上一个温暖的现在,每一个真实的现在,都是我们曾经幻想的未来!
分页: 1/1 第一页 1 最后页 [ 显示模式: 摘要 | 列表 ]
Jan 18
一、RPM包下载地址:
http://dev.mysql.com/downloads/repo/yum/

请根据自己的操作系统,选择要下载的rpm包:
Red Hat Enterprise Linux 7/CentOS 7
mysql57-community-release-el7-9.noarch.rpm
Red Hat Enterprise Linux 6/CentOS 6
mysql57-community-release-el6-9.noarch.rpm
Red Hat Enterprise Linux 5/CentOS 5
mysql57-community-release-el5-7.noarch.rpm

以CentOS 6为例:
wget https://repo.mysql.com//mysql57-community-release-el6-9.noarch.rpm


二、安装:


2.1、选择要安装的MySQL版本:


2.2、安装MySQL,默认安装的版本是5.7,所以不需要做任何的修改。


2.3、安装其他版本,假如你想安装MySQL5.6或者其他版本,需要修改 /etc/yum.repos.d/mysql-community.repo文件。


三、启动MySQL服务


3.1、查看MySQL状态


对于MySQL5.7版本,系统初始化之后会生成root账户的密码,保存在日志文件里,使用grep 'temporary password' /var/log/mysqld.log 查看初始密码,MySQL5.7的密码要求至少包含一个大写字母,一个小写字母,一个数字和一个特殊字符,并且总密码长度至少为8个字符。

3.2、修改密码


3.3、安装其他MySQL产品和组件


官方文档:
https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/
Jul 27
一、今天编译安装了MySQL5.6.31,安装启动之后错误日志报以下Warning信息:
160727 12:52:32 mysqld_safe Starting mysqld daemon with databases from /home/mysql/3307/data
2016-07-27 12:52:33 0 [Note] /usr/local/webserver/mysql56/bin/mysqld (mysqld 5.6.31-log) starting as process 26248 ...
2016-07-27 12:52:33 26248 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-07-27 12:52:33 26248 [Note] InnoDB: The InnoDB memory heap is disabled
2016-07-27 12:52:33 26248 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-07-27 12:52:33 26248 [Note] InnoDB: Memory barrier is not used
2016-07-27 12:52:33 26248 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-07-27 12:52:33 26248 [Note] InnoDB: Using CPU crc32 instructions
2016-07-27 12:52:33 26248 [Note] InnoDB: Initializing buffer pool, size = 512.0M
2016-07-27 12:52:33 26248 [Note] InnoDB: Completed initialization of buffer pool
2016-07-27 12:52:33 26248 [Note] InnoDB: Highest supported file format is Barracuda.
2016-07-27 12:52:33 26248 [Note] InnoDB: 128 rollback segment(s) are active.
2016-07-27 12:52:33 26248 [Note] InnoDB: Waiting for purge to start
2016-07-27 12:52:33 26248 [Note] InnoDB: 5.6.31 started; log sequence number 1601096
2016-07-27 12:52:33 26248 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3307
2016-07-27 12:52:33 26248 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
2016-07-27 12:52:33 26248 [Note] Server socket created on IP: '0.0.0.0'.
2016-07-27 12:52:33 26248 [Warning] 'user' entry 'root@localhost.localdomain' ignored in --skip-name-resolve mode.
2016-07-27 12:52:33 26248 [Warning] 'user' entry '@localhost.localdomain' ignored in --skip-name-resolve mode.
2016-07-27 12:52:33 26248 [Warning] 'proxies_priv' entry '@ root@localhost.localdomain' ignored in --skip-name-resolve mode.
2016-07-27 12:52:33 26248 [Warning] InnoDB: Cannot open table mysql/slave_master_info from the internal data dictionary of InnoDB though the .frm file for th
e table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.
2016-07-27 12:52:33 26248 [Warning] Info table is not ready to be used. Table 'mysql.slave_master_info' cannot be opened.
2016-07-27 12:52:33 26248 [Warning] InnoDB: Cannot open table mysql/slave_worker_info from the internal data dictionary of InnoDB though the .frm file for th
e table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.
2016-07-27 12:52:33 26248 [Warning] InnoDB: Cannot open table mysql/slave_relay_log_info from the internal data dictionary of InnoDB though the .frm file for
the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.
2016-07-27 12:52:33 26248 [Warning] Info table is not ready to be used. Table 'mysql.slave_relay_log_info' cannot be opened.
2016-07-27 12:52:33 26248 [Note] Event Scheduler: Loaded 0 events
2016-07-27 12:52:33 26248 [Note] /usr/local/webserver/mysql56/bin/mysqld: ready for connections.


BUG产生具体原因不详,官方bugs.mysql.com上有提供修复这5张表的SQL文件,下载链接:http://bugs.mysql.com/file.php?id=19725

下面我们就按照文件的说明操作
  1. drop these tables from mysql:
     innodb_index_stats
     innodb_table_stats
     slave_master_info
     slave_relay_log_info
     slave_worker_info
  
  2. delete all .frm & .ibd of the tables above.
  
  3. run this file to recreate the tables above (source five-tables.sql).
  
  4. restart mysqld.

二、具体操作步骤
2.1、删除这5张表
drop table if exists innodb_index_stats;
drop table if exists innodb_table_stats;
drop table if exists slave_master_info;
drop table if exists slave_relay_log_info;
drop table if exists slave_worker_info;
点击在新窗口中浏览此图片

2.2、删除这5张表对应的.frm和.ibd文件
点击在新窗口中浏览此图片
rm -f /home/mysql/3307/data/mysql/*.ibd

2.3、导入下载的five-tables.sql文件
source /home/sql/five-tables.sql

2.4、导入完成之后,重新启动MYSQL服务

三、检验结果:
点击在新窗口中浏览此图片
已经没有报错信息了。
Aug 14
140814 15:28:44 mysqld_safe Starting mysqld daemon with databases from /home/mysql2015/data
2014-08-14 15:28:45 15388 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-08-14 15:28:45 15388 [Note] InnoDB: The InnoDB memory heap is disabled
2014-08-14 15:28:45 15388 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-08-14 15:28:45 15388 [Note] InnoDB: Memory barrier is not used
2014-08-14 15:28:45 15388 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-08-14 15:28:45 15388 [Note] InnoDB: Using Linux native AIO
2014-08-14 15:28:45 15388 [Note] InnoDB: Using CPU crc32 instructions
2014-08-14 15:28:45 15388 [Note] InnoDB: Initializing buffer pool, size = 1.0G
2014-08-14 15:28:45 15388 [Note] InnoDB: Completed initialization of buffer pool
2014-08-14 15:28:45 15388 [Note] InnoDB: Highest supported file format is Barracuda.
2014-08-14 15:28:45 15388 [Note] InnoDB: 128 rollback segment(s) are active.
2014-08-14 15:28:45 15388 [Note] InnoDB: Waiting for purge to start
2014-08-14 15:28:45 15388 [Note] InnoDB: 5.6.20 started; log sequence number 1661278
2014-08-14 15:28:45 15388 [Note] RSA private key file not found: /home/mysql2015/data//private_key.pem. Some authentication plugins will not work.
2014-08-14 15:28:45 15388 [Note] RSA public key file not found: /home/mysql2015/data//public_key.pem. Some authentication plugins will not work.

2014-08-14 15:28:45 15388 [Note] Server hostname (bind-address): '0.0.0.0'; port: 2015
2014-08-14 15:28:45 15388 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
2014-08-14 15:28:45 15388 [Note] Server socket created on IP: '0.0.0.0'.
2014-08-14 15:28:46 15388 [Note] Event Scheduler: Loaded 0 events
2014-08-14 15:28:46 15388 [Note] /usr/local/webserver/mysql2015/bin/mysqld: ready for connections.
Version: '5.6.20-log'  socket: '/tmp/mysql2015.sock'  port: 2015  Source distribution
处理了一个MySQL Plugin 'FEDERATED' is disabled 的问题,发现日志里还有一个RSA private key file not found的问题,sha256_password这个插件是MySQL5.6内置的,支持更为强大的用户密码加密方式。

解决方法:

openssl genrsa -out mykey.pem 1024
openssl rsa -in mykey.pem -pubout > mykey.pub


chmod 400 mykey.pem
chmod 444 mykey.pub
chown mysql:mysql mykey.pem
chown mysql:mysql mykey.pub


vi my.cnf 在[mysqld]下面加以下两行:
sha256_password_private_key_path=/home/mysql2015/mykey.pem
sha256_password_public_key_path=/home/mysql2015/mykey.pub
保存之后,重启MYSQL服务,日志不再有以下错误了
RSA private key file not found: /home/mysql2015/data//private_key.pem. Some authentication plugins will not work.
RSA public key file not found: /home/mysql2015/data//public_key.pem. Some authentication plugins will not work.
分页: 1/1 第一页 1 最后页 [ 显示模式: 摘要 | 列表 ]