www.91084.com

GVKun编程网logo

centos同时运行mysql5.6和mysql5.7

15

在本文中,我们将为您详细介绍centos同时运行mysql5.6和mysql5.7的相关知识,此外,我们还会提供一些关于CentOS6.5安装MySQL5.6并用NavicatforMySQL连接、C

在本文中,我们将为您详细介绍centos同时运行mysql5.6和mysql5.7的相关知识,此外,我们还会提供一些关于CentOS 6.5 安装 MySQL5.6 并用Navicat for MySQL 连接、CentOS 6下编译安装mySQL5_MySQL、CentOS 7 源码安装 mysql5.7.12 完整教程¢OS下mysql开启远程连接、centos 7安装mysql5.5的方法_MySQL的有用信息。

本文目录一览:

centos同时运行mysql5.6和mysql5.7

centos同时运行mysql5.6和mysql5.7

centos同时运行MysqL5.6和MysqL5.7

一、准备

  1. 从MysqL官网下载MysqL5.6和MysqL5.7

  2. 关闭防火墙,关闭selinux

  3. 创建MysqL用户

~]# useradd MysqL

二、安装

先安装MysqL5.6

1.解压,并改名

~]# tar xfmysql-5.6.40-linux-glibc2.12-x86_64.tar.gz -C /opt

~]# cd /opt

~]# mvmysql-5.6.40-linux-glibc2.12-x86_64 MysqL56

2.初始化MysqL

~]# cd MysqL56

~]#./scripts/MysqL_install_db --user=MysqL --datadir=/opt/MysqL56/data --basedir=/opt/MysqL56

注:如果在安装的过程中出现

解决方法是安装autoconf库

执行命令:yum -y install autoconf

安装完成之后继续执行安装MysqL的命令

这时候会在MysqL中自动创建一个文件my.cng,编辑这个文件

[MysqLd]
basedir=/opt/MysqL56
datadir=/opt/MysqL56/data
port=3316
socket=/opt/MysqL56/MysqL.sock
explicit_defaults_for_timestamp=true
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

3.运行启动MysqL56

~]#./bin/MysqLd_safe --defaults-file=/opt/MysqL56/my.cnf --user=root &

接下来安装MysqL5.7

1.解压,并改名

~]# tar xfMysqL-5.7.22-linux-glibc2.12-x86_64.tar.gz -C /opt

~]# cd /opt

~]# mvMysqL-5.7.22-linux-glibc2.12-x86_64 MysqL57

2.编辑my.cnf

~]# vim /etc/my.cnf

[client]
port=3326
default-character-set=utf8
socket=/opt/MysqL57/MysqL.sock
[MysqL]
port=3326
socket=/opt/MysqL57/MysqL.sock
[MysqLd]
bind-address=0.0.0.0
log_error=/opt/MysqL57/log/MysqLd_error.log
slow_query_log_file=/opt/MysqL57/log/MysqLd_slow.log
general_log_file=/opt/MysqL57/log/MysqLd_gener.log
basedir=/opt/MysqL57
datadir=/opt/MysqL57/data
port=3326
socket=/opt/MysqL57/MysqL.sock
explicit_defaults_for_timestamp=true
tmpdir=/opt/MysqL57
pid-file=/opt/MysqL57/MysqLd.pid

~]# mkdir data log

~]# bin/MysqLd --initialize --user=MysqL --basedir=/opt/MysqL57 --datadir=/opt/MysqL57/data

~]#cat log/MysqLd_error.log

记下红框中的密码,这个是MysqL的root用户密码

~]#mv /etc/my.cnf ./

~]#bin/MysqLd_safe --defaults-file=/opt/MysqL57/my.cnf --user=root &

至此,CentOS中同时安装MysqL5.6和MysqL5.7完成!!!

CentOS 6.5 安装 MySQL5.6 并用Navicat for MySQL 连接

CentOS 6.5 安装 MySQL5.6 并用Navicat for MySQL 连接

1.卸载自带mysql

[root@localhost  ~]# yum remove mysql mysql-server mysql-libs

检查是否有残留 

[root@localhost  ~]# rpm -qa | grep -i mysql

若发现有则使用rpm -e 安装包名称 来卸载


2.安装

2.1下载rpm 安装包 : MySQL-5.6.26-1.rhel5.x86_64.rpm-bundle.tar  地址:http://mirrors.sohu.com/mysql/MySQL-5.6/

2.2解压下载的rpm 安装包  ,cd 进入解压目录, 顺序安装下面三个文件:

[root@localhost  ~]# rpm -ivh MySQL-server-5.6.26-1.linux_glibc2.5.x86_64.rpm

[root@localhost  ~]# rpm -ivh MySQL-client-5.6.26-1.linux_glibc2.5.x86_64.rpm

[root@localhost  ~]# rpm -ivh MySQL-devel-5.6.26-1.linux_glibc2.5.x86_64.rpm


安装完成

[root@localhost ~]# service mysql start

提示mysql成功启动,则安装完成 , 因为mysql 首次登录必须修改密码所以请看下面.


3.修改密码

3.1找到MySQL的初始密码 :[root@localhost ~]#  more /root/.mysql_secret

The random password set for the root user at Sun Aug  2 19:42:38 2015 (local t
ime): o0WlzPg0Nm7C2TA4 ;
o0WlzPg0Nm7C2TA4 就是密码  .

3.2 首次登录修改密码

[root@localhost ~]# mysql -u root -po0WlzPg0Nm7C2TA4

mysql > SET PASSWORD = PASSWORD(''123456'');

这样首次登录修改密码就成功了,下次登录就用上面语句中的密码

3.3后面还想修改密码就用下面的语句:

[root@localhost ~]# use mysql; 

[root@localhost ~]# update user set password=password(''新密码'') where user=''root'';

[root@localhost ~]# FLUSH PRIVILEGES; (刷新权限)

[root@localhost ~]# quit;  


4.配置远程访问

登录

[root@localhost ~]#  mysql -u root -p

登录成功后, 有两种权限设置:

1. 用root从任何主机连接到mysql服务器

mysql > GRANT ALL PRIVILEGES ON *.* TO ''root''@''%'' IDENTIFIED BY ''123456'' WITH GRANT OPTION;flush privileges;


2. 用root从192.168.1.16主机连接到mysql服务器

mysql > GRANT ALL PRIVILEGES ON *.* TO ''root''@''192.168.1.16'' IDENTIFIED BY ''123456'' WITH GRANT OPTION;flush privileges;


参数说明 : 

*.* 指 数据库.表 所以*.* 为所有数据库和表.

''root'' @''%'' 为所有主机.

IDENTIFIED BY ''123456'' 为远程登录的密码.

5. SQLyog  Windows端连接mysql服务器(Navicat for mysql 配置也一样)

登陆配置如下:

1.配置SSH

SSH Host Address : centos ip 

Usernanme : root

SSH Port : 22

Password : centos 登录密码

2. 常规标签页

MySQL Host Address : localhost

Password: mysql 密码

Port : 3306

CentOS 6下编译安装mySQL5_MySQL

CentOS 6下编译安装mySQL5_MySQL

CentOS

bitsCN.com

一,准备工作
     1,快速安装安装 centos6,安装时选择最小化安装.
     2,安装mysql编译时需要的库文件,这时可以选择做光盘yum
       [root@admin share] # cd /media/
       [root@admin media] # mkdir centos
       [root@admin media] # mount /dev/cdrom /media/centos
       [root@admin media]# cd /etc/yum.repos.d/
       [root@admin yum.repos.d] # mv centos-base.repo      centos-base.repo.bak
       [root@admin yum.repos.d] # mv centos-debuginfo.repo    centos-debuginfo.repo.bak
        至此,用光盘做的yum就可用了;
      [root@admin ~]#yum --enablerepo=c6-media install ncurses*  gcc* perl* -y
      3,准备好安装包. (这里以 mysql-5.0.56.tar.gz举例)
      4,添加mysql 用户
     [root@admin ~]#groupadd mysql
     [root@admin ~]#useradd -g mysql mysql -s /bin/nologin
 
二,正式安装
      1. [root@admin software]#tar zxvf mysql-5.0.56.tar.gz   
      2. [root@admin software]# cd mysql-5.0.56
      3. [root@admin mysql-5.0.56]# ./configure  --prefix=/usr/local/mysql  --localstatedir=/data/mysql --enable-assembler --                  enable-static --with-mysqld-user=mysql --with-big-tables --enable-thread-safe-client --                enable-local-infile --with-charset-utf8 --with-extra-charsets=all
      4. [root@admin mysql-5.0.56]# make && make install
      5. [root@admin mysql-5.0.56]# cp support-files/my-medium.cnf /etc/my.cnf
      6. [root@adim share]# cd /usr/local/mysql/
      7. [root@admin mysql]# bin/mysql_install_db --user=mysql
installing mysql system tables...
ok
filling help tables...
ok
 
to start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
 
please remember to set a password for the mysql root user !
to do so, start the server, then issue the following commands:
/usr/local/mysql/bin/mysqladmin -u root password ''new-password''
/usr/local/mysql/bin/mysqladmin -u root -h localhost.localdomain password ''new-password''
 
alternatively you can run:
/usr/local/mysql/bin/mysql_secure_installation
 
which will also give you the option of removing the test
databases and anonymous user created by default.  this is
strongly recommended for production servers.
 
see the manual for more instructions.
 
you can start the mysql daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &
 
you can test the mysql daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
 
please report any problems with the /usr/local/mysql/bin/mysqlbug script!
 
the latest information about mysql is available on the web at
http://www.mysql.com
support mysql by buying support/licenses at http://shop.mysql.com
 
 
   8. [root@admin mysql]# chown -r mysql.mysql /data/mysql/
   9. [root@admin mysql]#  share/mysql/mysql.server start
starting mysql success!                           #--------------> 看到如此,便知道安装成功了.
  10. [root@admin mysql]# netstat  -tunlp | grep mysql
      tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   listen      13193/mysqld

 

三. 后绪工作
 1.[root@admin ~]# ln -s  /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
 2.[root@admin ~]# ln -s  /usr/local/mysql/bin/mysql /usr/sbin/mysql
 3.[root@admin ~]# ln -s  /usr/local/mysql/bin/mysqladmin /usr/sbin/mysqladmin
 4.[root@admin ~]# ln -s  /usr/local/mysql/bin/mysqldump /usr/sbin/mysqldump
 5.[root@admin ~]# mysql -uroot -p
Welcome to the MySQL monitor.  Commands end with ; or /g.
Your MySQL connection id is 2
Server version: 5.0.56-log Source distribution
 
Type ''help;'' or ''/h'' for help. Type ''/c'' to clear the buffer.
 
mysql>

 

本文出自 “OpenSource滴天空” 博客

bitsCN.com

CentOS 7 源码安装 mysql5.7.12 完整教程&centOS下mysql开启远程连接

CentOS 7 源码安装 mysql5.7.12 完整教程¢OS下mysql开启远程连接

前期环境准备:

1.安装CentOS7 以最小化缺省安装

2.安装时选择并设置好网络

3.yum -y update 指令升级系统到最新版本


一:卸载旧版本MysqL

使用下面的命令检查是否安装有MySQLServer

rpm -qa | grep MysqL

有的话通过下面的命令来卸载掉

rpm -e MysqL   //普通删除模式
rpm -e --nodeps MysqL    // 强力删除模式,如果使用上面命令删除时,提示有依赖的其它文件,则用该命令可以对其进行强力删除

二:安装新版本MysqL

安装编译代码需要的包

yum -y install make gcc-c++ cmake bison-devel ncurses-devel libaio libaio-devel perl-Data-Dumper net-tools

#MysqL5.7.12要求boost_1_59_0版本
#boost官网http://www.boost.org/
#yum -y install boost boost-devel boost-doc安装的是boost1.53版本
#下载release版boost1.59 #http://www.boost.org/users/download/
cd /usr/local/src
wget http://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz
tar xvf boost_1_59_0
cd boost_1_59_0
./bootstrap.sh--with-libraries=system,filesystem,log,thread--with-toolset=gcc
./b2toolset=gcc cxxflags="-std=c++11"
#备注:上面红色字体的内容,参考如下配置;上面绿色字体内容代表使用c++11标准,编译的库要使用统一标准。不使用,去掉绿色字体内容。
  Component configuration:

 - atomic : not building
 - chrono : not building
 - context  : not building
 - coroutine    : not building
 - date_time    : not building
 - exception    : not building
 - filesystem     : building
 - graph  : not building
 - graph_parallel         : not building
 - iostreams    : not building
 - locale : not building
 - log  : building
 - math : not building
 - mpi  : not building
 - program_options          : not building
 - python : not building
 - random : not building
 - regex  : not building
 - serialization        : not building
 - signals  : not building
 - system : building
 - test : not building
 - thread : building
 - timer  : not building
 - wave : not building

./b2 install

#默认安装在/usr/local/lib目录下;头文件在/usr/local/include/boost目录下;install后面可以加参数 --prefix=/usr 来设置安装路径

#如果提示boost版本不对应则卸载boost安装对应版本boost

#boost卸载方法:

#1.显示已经安装文件

#rpm -qa | grep boost

#2.使用一下命令依次卸载

rpm -e --nodeps xxxx

下载MysqL 5.7.12

版本选择参考我的另一篇博文:http://www.jb51.cc/article/p-grvkhxwb-mm.html

wget http://dev.MysqL.com/get/Downloads/MysqL-5.7/MysqL-5.7.12.tar.gz
#检测MD5值是否与官网相同,不同重新找链接下载
md5sum MysqL-5.7.12.tar.gz
tar xvf MysqL-5.7.12.tar.gz
cd MysqL-5.7.12

编译安装

cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/MysqL \
-DMysqL_DATADIR=/usr/local/MysqL/data \
-DSYSconfdIR=/etc \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DMysqL_UNIX_ADDR=/var/lib/MysqL/MysqL.sock \
-DMysqL_TCP_PORT=3306 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci

make && make install

编译的参数可以参考:http://dev.mysql.com/doc/refman/5.5/en/source-configuration-options.html。

-DCMAKE_INSTALL_PREFIX=dir_name 设置MysqL安装目录
-DMysqL_UNIX_ADDR=file_name 设置监听套接字路径,这必须是一个绝对路径名。默认为/tmp/MysqL.sock
-DDEFAULT_CHARSET=charset_name 设置服务器的字符集。
缺省情况下,MysqL使用latin1的(CP1252西欧)字符集。cmake/character_sets.cmake文件包含允许的字符集名称列表。
-DDEFAULT_COLLATION=collation_name 设置服务器的排序规则。
-DWITH_INNOBASE_STORAGE_ENGINE=1
-DWITH_ARCHIVE_STORAGE_ENGINE=1
-DWITH_BLACKHOLE_STORAGE_ENGINE=1
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1
存储引擎选项:

MyISAM,MERGE,MEMORY,和CSV引擎是默认编译到服务器中,并不需要明确地安装。

静态编译一个存储引擎到服务器,使用-DWITH_engine_STORAGE_ENGINE= 1

可用的存储引擎值有:ARCHIVE,BLACKHOLE,EXAMPLE,FEDERATED,INNOBASE (InnoDB),PARTITION (partitioning support),和PERFSCHEMA (Performance Schema)
-DMysqL_DATADIR=dir_name 设置MysqL数据库文件目录
-DMysqL_TCP_PORT=port_num 设置MysqL服务器监听端口,默认为3306
-DENABLE_DOWNLOADS=bool 是否要下载可选的文件。例如,启用此选项(设置为1),cmake将下载谷歌所使用的测试套件运行单元测试。


注:重新运行配置,需要删除CMakeCache.txt文件

make clean  
rm CMakeCache.txt  


整个过程需要30分钟以上……耐心等待,笔者一个半小时。

三:配置MysqL

设置权限

使用下面的命令查看是否有MysqL用户及用户组

cat /etc/passwd 查看用户列表
cat /etc/group  查看用户组列表

如果没有就创建

groupadd MysqL
useradd -g MysqL MysqL

设置权限并初始化MysqL系统授权表
修改/usr/local/MysqL权限

chown -R MysqL:MysqL /usr/local/MysqL

初始化配置

进入安装路径

cd /usr/local/MysqL
注:在启动MysqL服务时,会按照一定次序搜索my.cnf,先在/etc目录下找,找不到则会搜索"$basedir/my.cnf",在本例中就是 /usr/local/MysqL/my.cnf,这是新版MysqL的配置文件的默认位置!

注意:在CentOS 6.4版操作系统的最小安装完成后,在/etc目录下会存在一个my.cnf,否则,该文件会干扰源码安装的MysqL的正确配置,造成无法启动。

解决方案一:改名

mv /etc/my.cnf /etc/my.cnf /etc/my.cnf.bak

以后在使用"yum update"更新系统后,需要检ls查下/etc目录下是否会多出一个my.cnf,如果多出,将它重命名成别的。否则,MysqL将使用这个配置文件启动,可能造成无法正常启动等问题。

解决方案二:直接用MysqL默认配置覆盖彻底解决(推荐)

[javascript] view plain copy 在CODE上查看代码片派生到我的代码片
sudo cp support-files/my-default.cnf /etc/my.cnf  
#可按需修改新的配置文件选项, 不修改配置选项, MysqL则按默认配置参数运行.   
如下是我修改配置文件/etc/my.cnf, 用于设置编码为utf8以防乱码  
我的my.cnf  

[MysqLd]

character_set_server=utf8
init_connect='SET NAMES utf8'

#datadir = /usr/local/MysqL/data

[client]

default-character-set=utf8
 

启动MysqL

添加服务,拷贝服务脚本到init.d目录,并设置开机启动

#拷贝启动文件到/etc/init.d/下并重命令为MysqL
cp support-files/MysqL.server /etc/init.d/MysqL
#增加执行权限

chmod 755 /etc/init.d/MysqL


#默认数据库初始化
bin/MysqL_install_db --basedir=/usr/local/MysqL --datadir=/usr/local/MysqL/data --user=MysqL

#检查自启动项列表中没有MysqL这个,如果没有就添加MysqL

chkconfig --list MysqL
chkconfig --add MysqL

#设置MysqL在345等级自动启动

chkconfig --level 345 MysqL on
#或用这个命令设置开机启动

10
#启动MysqL服务
service MysqL start
#或者
/etc/init.d/MysqL start
--------------------------
#MysqL服务的启动/重启/停止
#启动MysqL服务

service MysqLd start
#重启MysqL服务

service MysqLd restart
#停止MysqL服务

service MysqLd stop
--------------------------




配置用户

设置之前,我们需要先设置环境变量PATH,要不不能直接调用MysqL

vi /etc/profile +
#添加
export PATH=/usr/local/MysqL/bin:$PATH
#执行
source  /etc/profile

由于首次启动MysqL,即执行service MysqL start后默认生成一个随机密码,造成登录失败:

MysqL -uroot
#ERROR 1045(28000): Access denied for user 'root'@'localhost'(using password: NO)
MysqL -uroot -p
#ERROR 1045(28000): Access denied for user 'root'@'localhost'(using password: YES)
解决方案一(推荐):随机密码存放在/root/.MysqL_secret
vi /root/.MysqL_secret
@H_543_301@#复制密码后修改成自己密码 bin/MysqLadmin -uroot -p password yournewpassword Enter password:粘贴旧密码(系统生成的随机密码) 
遇到[ERROR] unkNown variable 'sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES'问题
vi /etc/my.cnf
最后一行注掉
#sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
#测试登录
MysqL -uroot -p
@H_543_301@Enter password:yournewpassword

解决方案二:(如果第一种方案无法解决)参考我的另一篇博文:http://www.jb51.cc/article/p-bacegnvz-mm.html

然后可以操作数据库啦

MysqL>show databases;
MysqL>use MysqL;
MysqL>show tables;
MysqL>quit;

若要设置root用户可以远程访问,执行

MysqL> GRANT ALL PRIVILEGES ON *.* TO 'root'@'172.16.%' IDENTIFIED BY 'password' WITH GRANT OPTION;

红色的password为远程访问时,root用户的密码,可以和本地不同。

配置防火墙

参考我的另一篇博文:http://www.jb51.cc/article/p-kpynjuav-mm.html

防火墙的3306端口默认没有开启,若要远程访问,需要开启这个端口

vi /etc/sysconfig/iptables

在“-A INPUT –m state --state NEW –m tcp –p –dport 22 –j ACCEPT”,下添加:

-A INPUT -m state --state NEW -m tcp -p -dport 3306 -j ACCEPT

然后保存,并关闭该文件,在终端内运行下面的命令,刷新防火墙配置:

service iptables restart
测试:
在windows cmd:
telnet 192.168.19.131 3306
OK,一切配置完毕,你可以访问你的MysqL了~

centOS下MysqL开启远程连接

CentOS系统安装好MysqL后,默认情况下不支持用户通过非本机连接上数据库服务器,下面是解决方法:

1、在控制台执行 MysqL -u root -p MysqL,系统提示输入数据库root用户的密码,输入完成后即进入MysqL控制台,这个命令的第一个MysqL是执行命令,第二个MysqL是系统数据名称,不一样的。

2、在MysqL控制台执行 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'MyPassword' WITH GRANT OPTION;

FLUSH PRIVILEGES;

3、在MysqL控制台执行命令中的 'root'@'%' 可以这样理解: root是用户名,%是主机名或IP地址,这里的%代表任意主机或IP地址,你也可替换成任意其它用户名或指定唯一的IP地址;'MyPassword'是给授权用户指定的登录数据库的密码;另外需要说明一点的是我这里的都是授权所有权限,可以指定部分权限,GRANT具体操作详情见:http://dev.MysqL.com/doc/refman/5.1/en/grant.html

4、不放心的话可以在MysqL控制台执行 select host,user from user; 检查一下用户表里的内容

到此还是在客户端还是连接不上

此时检查下防火墙是否开启:

/etc/init.d/iptables status

会得到一系列信息,说明防火墙开着。则关闭:

/etc/init.d/iptables stop

永久关闭::

chkconfig --level 35 iptables off

再次连接,可以了

centos 7安装mysql5.5的方法_MySQL

centos 7安装mysql5.5的方法_MySQL

首先centos7 已经不支持mysql,因为收费了你懂得,所以内部集成了mariadb,而安装mysql的话会和mariadb的文件冲突,所以需要先卸载掉mariadb,以下为卸载mariadb,安装mysql的步骤。

#列出所有被安装的rpm package
rpm -qa | grep mariadb

#卸载
rpm -e mariadb-libs-5.5.37-1.el7_0.x86_64
错误:依赖检测失败:
libmysqlclient.so.18()(64bit) 被 (已安裝) postfix-2:2.10.1-6.el7.x86_64 需要
libmysqlclient.so.18(libmysqlclient_18)(64bit) 被 (已安裝) postfix-2:2.10.1-6.el7.x86_64 需要

#强制卸载,因为没有--nodeps
rpm -e --nodeps mariadb-libs-5.5.37-1.el7_0.x86_64

#安装mysql依赖
yum install vim libaio net-tools

#安装mysql5.5.39的rpm包
rpm -ivh /home/liwei/MySQL-server-5.5.39-2.el6.x86_64.rpm

rpm -ivh /home/liwei/MySQL-client-5.5.39-2.el6.x86_64.rpm

#拷贝配置文件
cp /usr/share/mysql/my-medium.cnf /etc/my.cnf,改名为my.cnf作为mysql配置文件。

#修改响应的配置文件
vim /etc/my.cnf

#把mysql的data拷贝到制定的目录
mv /var/lib/mysql /home/mysql/data/

还要注意目录的属主和权限。

MYSQL启动后报:ERROR! The server quit without updating PID file错误的问题解决
MYSQL日志:Can''t find file: ''./mysql/plugin.frm'' (errno: 13 - Permission denied)


1、权限不够:chown -R mysql:mysql /home/mysql/data” “chmod -R 755 /home/mysql/data
2、centos7的selinux问题:打开/etc/selinux/config,把SELINUX=enforcing改为SELINUX=disabled后存盘退出重启机器。

下面看下其他网友的补充:

1、centos下yum暂时没有mysql-server直接安装包;
MariaDB是MySQL社区开发的分支,也是一个增强型的替代品;

2、安装MariaDB
yum -y install mariadb-server mariadb mariadb-devel
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation
firewall-cmd --permanent --add-service mysql
systemctl restart firewalld.service
iptables -L -n|grep 3306

3、登录数据库查看下是否有变好
msyql -uroot -p
show databases;

今天的关于centos同时运行mysql5.6和mysql5.7的分享已经结束,谢谢您的关注,如果想了解更多关于CentOS 6.5 安装 MySQL5.6 并用Navicat for MySQL 连接、CentOS 6下编译安装mySQL5_MySQL、CentOS 7 源码安装 mysql5.7.12 完整教程¢OS下mysql开启远程连接、centos 7安装mysql5.5的方法_MySQL的相关知识,请在本站进行查询。

本文标签: