这里我们记录下在实际工作中安装的mysql5.6版本的步骤,在安装过程中会遇到了一些问题,这里我们也记录下来,进行总结吧!!
使用命令rpm -ivh MySQL-server-5.6.34-1.el6.x86_64.rpm
rpm -ivh MySQL-server-5.6.34-1.el6.x86_64.rpm
warning: MySQL-server-5.6.34-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:/usr/bin/perl is needed by MySQL-server-5.6.34-1.el6.x86_64
解决方法:
yum install perl
yum install libaio
若实际服务器没有网络,则需要挂载光盘进行,进入镜像路径,强制安装
rpm -ivh *.rpm --nodeps --force
报错:file /usr/share/mysql/czech/errmsg.sys from install of MySQL-server-5.6.34-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
解决方法:
yum -y remove mysql-libs-*
遇到错误
[root@wcpdb setup]# rpm -ivh MySQL-server-5.6.34-1.el6.x86_64.rpm
warning: MySQL-server-5.6.34-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
MySQL-server conflicts with mysql-server-5.1.71-1.el6.x86_64
rpm -e mysql-server-5.1.71-1.el6.x86_64 --nodeps
遇到问题提示冲突
file /usr/share/mysql/czech/errmsg.sys from install of MySQL-server-5.6.34-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
解决方法:强制安装
rpm -ivh MySQL-server-5.6.34-1.el6.x86_64.rpm --nodeps --force
标记的位置为mysql初始的密码所在的文件位置。请记住这个位置。因为安装完后首次登需要到该文件查看初始密码
cat /root/.mysql_secret
记录密码zHpv6kqrdRvtoYQl
service mysql start
使用命令
rpm -ivh MySQL-client-5.6.34-1.el6.x86_64.rpm
使用命令:mysql -uroot -p,密码为刚才记录的密码。
mysql -uroot -p
SET PASSWORD = PASSWORD('123456');
退出登录的Mysql
修改my.cnf
vi /usr/my.cnf
设置忽略表名大消息
在[mysqld]下加入一行:lower_case_table_names=1
设置接收包大小
在[mysqld]下加入一行:
max_allowed_packet=50M
service mysql restart
遇到问题:使用本机的工具连接测试mysql时报错:XXXXX is not allowed to connect to this MySQL server
解决办法
登录MySQL后执行GRANT ALL PRIVILEGES ON . TO ‘root’@’%’ IDENTIFIED BY ‘123456’ WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
1.执行命令:mysql -uroot -p
mysql -uroot -p123456
2. 创建数据库
执行命令:CREATE DATABASE IF NOT EXISTS im_plugins DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
CREATE DATABASE IF NOT EXISTS im_plugins DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
3.创建用户
执行命令:CREATE USER ‘skyfans’@’%’ IDENTIFIED BY ‘5vizTUhdijKL’;
CREATE USER 'skyfans'@'%' IDENTIFIED BY '5vizTUhdijKL';
4.授权访问库
执行命令: GRANT ALL ON im_plugins.* TO ‘skyfans ‘@’%’;
GRANT ALL ON im_plugins.* TO 'skyfans '@'%';
5.使用表
执行命令:use im_plugins;
6.导入全量脚本
source /root/1-table.sql
做完如上步骤可以通过连接mysql(使用工具)或者直接连接,查看表等内容是否导入成功!!