GVKun编程网logo

(实践应用)CentOS + MySQL5.7 Have No mysqld_safe

9

本篇文章给大家谈谈,以及实践应用CentOS+MySQL5.7HaveNomysqld_safe的知识点,同时本文还将给你拓展CentOS6.5安装MySQL5.6并用NavicatforMySQL连

本篇文章给大家谈谈,以及实践应用CentOS + MySQL5.7 Have No mysqld_safe的知识点,同时本文还将给你拓展CentOS 6.5 安装 MySQL5.6 并用Navicat for MySQL 连接、CentOS 6下编译安装mySQL5_MySQL、centos 7 单独安装 mysql 和 mysqli 和 pdo_mysql 扩展、CentOS 7 源码安装 mysql5.7.12 完整教程¢OS下mysql开启远程连接等相关知识,希望对各位有所帮助,不要忘了收藏本站喔。

本文目录一览:

(实践应用)CentOS + MySQL5.7 Have No mysqld_safe

(实践应用)CentOS + MySQL5.7 Have No mysqld_safe

https://stackoverflow.com/questions/33510184/change-mysql-root-password-on-centos7/34207996#34207996

  • systemd is Now used to look after MysqL instead of MysqLd_safe (which is why you get the -bash: MysqLd_safe: command not found error - it’s not installed)
  • The user table structure has changed.

    1. Stop MysqL:
      systemctl stop MysqLd

    2. Set the MysqL environment option
      systemctl set-environment MysqLD_OPTS=”–skip-grant-tables”

    3. Start MysqL usig the options you just set
      systemctl start MysqLd

    4. Login as root
      MysqL -u root

    5. Update the root user password with these MysqL commands
      MysqL> UPDATE MysqL.user SET authentication_string = PASSWORD(‘MyNewPassword’)
      -> WHERE User = ‘root’ AND Host = ‘localhost’;
      MysqL> FLUSH PRIVILEGES;
      MysqL> quit

    6. Stop MysqL
      systemctl stop MysqLd

    7. Unset the MysqL envitroment option so it starts normally next time
      systemctl unset-environment MysqLD_OPTS

    8. Start MysqL normally:
      systemctl start MysqLd

    9. Try to login using your new password:
      MysqL -u root -p

Reference

As it says at http://dev.mysql.com/doc/refman/5.7/en/mysqld-safe.html,

Note

As of MysqL 5.7.6,for MysqL installation using an RPM distribution,server startup and shutdown is managed by systemd on several Linux platforms. On these platforms,MysqLd_safe is no longer installed because it is unnecessary. For more information,see Section 2.5.10,“Managing MysqL Server with systemd”.Which takes you to http://dev.mysql.com/doc/refman/5.7/en/server-management-using-systemd.html where it mentions the systemctl set-environment MysqLD_OPTS= towards the bottom of the page

The password reset commands are at the bottom of
http://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html

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 单独安装 mysql 和 mysqli 和 pdo_mysql 扩展

centos 7 单独安装 mysql 和 mysqli 和 pdo_mysql 扩展

一.mysql 扩展

下载地址:http://git.php.net/?p=pecl/database/mysql.git;a=summary

下载PHP7的传统mysql扩展下载 PHP7 的传统 mysql 扩展于 windows 下,然后再通过其它方式下载到 linux 上。

下载后命令如下:

tar zxf mysql-230a828.tar.gz

cd mysql-230a828

/usr/local/php/bin/phpize

./configure --with-php-config=/usr/local/php/bin/php-config --with-mysql=/usr/local/mysql

./configure --with-php-config=/opt/php/bin/php-config --with-mysql=mysqlnd

make && make install

然后修改 php.ini

添加 extension=mysql.so

二.mysqli 扩展

1: 用 find 命令,查找一下 mysqli 的文件目录,find /-name "mysqli"

2: cd 到 mysqli 文件目录下,执行 /usr/local/php/bin/phpize

3:./configure --with-php-config=/usr/local/php/bin/php-config --with-mysqli=/usr/local/mysql/bin/mysql_config

4:   make

5:   make test

6:   make install

(不出错就会显示 Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-zts-20151012 / 之类)

  现在 mysqli.so 文件就出来了,在 /usr/local/php/lib/php/extensions/no-debug-zts-20151012/ 下  

7. 直接在 php.ini 里把这个文件加载即可

  extension_dir="/usr/local/php/ext”  

       extension=mysqli.so

  保存退出并把 mysqli.so 这个文件 cp 到 /usr/local/php/ext 下,  然后重启 web 服务器

若./configure 配置的时候报错:configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.

解决方法:

wget https://sourceforge.net/projects/re2c/files/0.16/re2c-0.16.tar.gz 
tar zxf re2c-0.16.tar.gz && cd re2c-0.16 
./configure 
make && make install

make 时报错:error: ext/mysqlnd/mysql_float_to_double.h: No such file or directory

解决方法:

# pwd 
/home/neo/tools/php-5.5.28/ext/mysqli
# vim mysqli_api.c
把第36行的
#include "ext/mysqlnd/mysql_float_to_double.h"
修改为
#include "/home/neo/tools/php-5.5.28/ext/mysqlnd/mysql_float_to_double.h"

或参考链接:http://blog.csdn.net/youcijibi/article/details/77002714

三.pdo_mysql 扩展

大致同 mysqli 扩展

./configure --with-php-config=${php52_dir}/bin/php-config --with-pdo-mysql=${mysql_dir}
make

make install

手动开启 PDO,在 php-ini 文件上开启,连接数据库用。mysql 开启 PDO, 在 php.ini 加上 extension=pdo_mysql.so,extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613", 重启 web 服务器

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 + MySQL5.7 Have No mysqld_safe的分享已经告一段落,感谢您的关注,如果您想了解更多关于CentOS 6.5 安装 MySQL5.6 并用Navicat for MySQL 连接、CentOS 6下编译安装mySQL5_MySQL、centos 7 单独安装 mysql 和 mysqli 和 pdo_mysql 扩展、CentOS 7 源码安装 mysql5.7.12 完整教程¢OS下mysql开启远程连接的相关信息,请在本站查询。

本文标签: