二进制方式安装mysql-5.6.16
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了二进制方式安装mysql-5.6.16相关的知识,希望对你有一定的参考价值。
一、检查系统版本
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.4 (Santiago)
二、添加用户与组
# groupadd mysql
# useradd -g mysql mysql
三、安装MySQL到/usr/local/mysql下
#cd /usr/local
#tar zxvf mysql-5.6.16-linux-glibc2.5-x86_64.tar.gz
#mv mysql-5.6.16-linux-glibc2.5-x86_64/ mysql
四、修改mysql目录的所有者和所属组位mysql
# chown -R mysql:mysql mysql/ .
五、初始化
#scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data 初始化
#cp support-files/mysql.server /etc/init.d/mysqld
六、修改配置文件
#cp /usr/local/mysql/my.cnf /etc/my.cnf
#vim /etc/my.cnf
[mysqld]
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
port = 3306
server_id = 1
socket = /tmp/mysql.sock
[client]
socket = /tmp/mysql.sock
七、启动mysql服务
#ln -s /usr/local/mysql/bin/mysql /usr/bin 软链接
#service mysqld start
八、登陆mysql并且删除空用户
mysql> select user,host,password from mysql.user;
+------+-----------+----------+
| user | host | password |
+------+-----------+----------+
| root | localhost | |
| root | mysql | |
| root | 127.0.0.1 | |
| root | ::1 | |
| | localhost | |
| | mysql | |
+------+-----------+----------+
6 rows in set (0.00 sec)
mysql> UPDATE mysql.user set password = PASSWORD(‘gechong‘) WHERE user = ‘root‘;
mysql> DROP USER ‘‘@localhost;
mysql> FLUSH PRIVILEGES;
以上是关于二进制方式安装mysql-5.6.16的主要内容,如果未能解决你的问题,请参考以下文章
phpmyadmin+mysql-5.6.16.tar.gz使用
Linux(CentOS 6.5) 下安装MySql 5.7.18 二进制版本粗浅攻略
fbf centos7.2 二进制方式安装mariadb-10.4.8-linux-systemd-x86_64.tar.gz