centos6.3 安装mysql5.6

作者: 数据库信息  发布:2019-07-26

1、去官方网站下载MySQL,

redhat6.3安装MySQL-server-5.6.13-1.el6.x86_64.rpm

选择redhat6 64bit

 

澳门金莎娱乐网站 1

首先下载上面多个公文:

  下载rpm bundle

 

澳门金莎娱乐网站 2

[plain] 

2、将文件拷贝到centos,解压 tar -xvf MySQL-5.6.39-1.el6.x86_64.rpm-bundle.tar

MySQL-client-5.6.13-1.el6.x86_64.rpm  

3、检查是还是不是已设置mysql,rpm -qa|grep mysql ,固然有,运维 rpm -e 卸载

MySQL-devel-5.6.13-1.el6.x86_64.rpm  

4、安装mysql  

MySQL-server-5.6.13-1.el6.x86_64.rpm  

  rpm -ivh MySQL-client-5.6.39-1.el6.x86_64.rpm

接下来利用root账号登入,进行设置:

  rpm -ivh MySQL-devel-5.6.39-1.el6.x86_64.rpm

  1. 安装server、devel、client:1. 安装server、devel、client:

  rpm -ivh MySQL-server-5.6.39-1.el6.x86_64.rpm

 

澳门金莎娱乐网站 ,  安装MySQL-server-5.6.39-1.el6.x86_64.rpm的时候大概会报错,缺乏包

rpm -ivh --replacefiles MySQL-s*.rpm 

  那都以因为贫乏依赖的连锁包变成的,消除办法是由此yum直接设置那一个依赖包。 
yum -y install libaio 
yum -y install numactl

rpm -ivh --replacefiles MySQL-d*.rpm

5、将配备文件拷贝到/etc目录下,cp /usr/share/mysql/my-default.cnf  /etc/my.cnf

 

  修改配置文件 vi /etc/my.cnf 在[mysqld]上面加上

rpm -ivh --replacefiles MySQL-c*.rpm

  skip-grant-tables

 

*  否则登入时会报 错:*

 

  [root@localhost ~]# mysql -u root -p
  Enter password:
  ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

[[email protected] download]# rpm -ivh --replacefiles MySQL-server-5.6.13-1.el6.x86_64.rpm   

6、启动mysql  service mysql start

Preparing...                ########################################### [100%]  

7、登入mysql,这一步不必要输密码 直接输mysql 就能够,修改root密码

   1:MySQL-server           ########################################### [100%]  

mysql> update mysql.user set authentication_string=password('root') where user='root';
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4 Changed: 4 Warnings: 0

[[email protected] download]# rpm -ivh --replacefiles MySQL-client-5.6.13-1.el6.x86_64.rpm   

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

Preparing...                ########################################### [100%]  

mysql> exit
Bye

   1:MySQL-client           ########################################### [100%]  

vi /etc/my.cnf 将skip-grant-tables注释掉

[[email protected] download]# rpm -ivh --replacefiles MySQL-devel-5.6.13-1.el6.x86_64.rpm   

然后重启mysql 

Preparing...                ########################################### [100%]  

service mysql restart

   1:MySQL-devel            ########################################### [100%]

8、登录mysql 

要移除安装可以使用 rpm -e MySQL-server  、 rpm -e MySQL-devel、MySQL-client就能够;

mysql -uroot -p

  1. 开头化数据库: 

 

/usr/bin/mysql_install_db 

 

  1. 启动mysql服务:

 

service mysql start

 

运用命令ps -ef | grep mysql 查看mysql进程:

 

 

[[email protected] ~]# ps -ef | grep mysql  

root     26047     1  0 18:14 pts/12   00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/localhost.localdomain.pid  

mysql    26227 26047  0 18:14 pts/12   00:00:01 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mysqld.log --pid-file=/var/lib/mysql/localhost.localdomain.pid --socket=/var/lib/mysql/mysql.sock  

root     26545 24726  0 18:27 pts/8    00:00:00 grep mysql

4.先是次登入设置root密码:

率先查看 cat /root/.mysql_secret

 

 

[email protected] ~]# cat /root/.mysql_secret   

# The random password set for the root user at Fri Aug 30 15:57:18 2013 (local time): fMYcarvB

下一场命令行:mysql -u root -p ,然后输入上边的密码就能够:

 

[[email protected] ~]# mysql -u root -p  

Enter password:   

本文由金沙澳门官网发布于数据库信息,转载请注明出处:centos6.3 安装mysql5.6

关键词: 金沙澳门官网