CentOS7.4 Mysql5.6 详细安装教程

Mysql5.6 详细安装教程
1. 查看系统是否有安装
rpm -qa |grep -i mysql
rpm -qa |grep -i mariadb
2. 如果有安装使用以下命令卸载
yum -y remove XXXX
3. 下载安装程序
wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-server-5.6.21-1.rhel5.x86_64.rpm
wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-devel-5.6.21-1.rhel5.x86_64.rpm
wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-client-5.6.21-1.rhel5.x86_64.rpm
4. 安装过程
rpm -ivh MySQL-server-5.6.21-1.rhel5.x86_64.rpm
rpm -ivh MySQL-devel-5.6.21-1.rhel5.x86_64.rpm
rpm -ivh MySQL-client-5.6.21-1.rhel5.x86_64.rpm
5. 安装报错处理
5.1 error: Failed dependencies:
libaio.so.1()(64bit) is needed by MySQL-server-5.6.21-1.rhel5.x86_64
libaio.so.1(LIBAIO_0.1)(64bit) is needed by MySQL-server-5.6.21-1.rhel5.x86_64
libaio.so.1(LIBAIO_0.4)(64bit) is needed by MySQL-server-5.6.21-1.rhel5.x86_64
解决:
下载:wget http://mirror.centos.org/centos/6/os/x86_64/Packages/libaio-0.3.107-10.el6.x86_64.rpm
安装:rpm -ivh libaio-0.3.107-10.el6.x86_64.rpm
5.2 FATAL ERROR: please install the following Perl modules before executing /usr/bin/mysql_install_db:
Data::Dumper
解决:yum install -y perl-Module-Install.noarch
6. 启动
复制配置文件:cp /usr/share/mysql/my-default.cnf /etc/my.cnf
初始化mysql: /usr/bin/mysql_install_db
初始化密码路径:/root/.mysql_secret
修改权限: chmod -R 777 /var/lib/mysql
启动: service mysql start
7. 修改root密码
mysql -u root -p 然后回车
SET PASSWORD = PASSWORD(‘a123456’); 设置root密码(网站将英文引号给搞成中文了,需要自己转一下)
exit 退出
mysql -uroot -pa123456 测试登录
8. 授权远程登录权限
use mysql 选择数据库实例
GRANT ALL PRIVILEGES ON . TO ‘root’@’%’ IDENTIFIED BY ‘a123456’ WITH GRANT OPTION; (网站将英文引号给搞成中文了,需要自己转一下)
FLUSH PRIVILEGES;

你可能感兴趣的:(软件安装界面,运维,环境变量)