处理一下出现的日志 Plugin 'FEDERATED' is disabled. 2017-11-15 19:23:46 16c0 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoD
最近服务器很不稳定,于是重装了mysql 和php 服务,但是接着却遇到了很头疼的麻烦。
远程连接mysql是总是提示:
代码如下:Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0
很明显这是连接初始化阶段就丢失了连接的错误。
google半天大多是说的注释掉配置文件中 bind-address = 127.0.0.1 这一句。
但是我的配置文件并没有配置这一句,
my.ini在MySQL的目录,于是在同事机器上拷贝了一个my.ini拿来修改,并单独放在一个地方作为备份。其内容如下:
代码如下:
#Uncomment or Add only the keys that you know how works.
#Read the MySQL Manual for instructions
[mysqld]
basedir=d:/MySQL5.0/
#bind-address=127.0.0.1
datadir=d:/MySQL5.0/data
1、在/etc/mysql/my.cnf中的[mysqld]段注释掉bind-address = 127.0.0.1
2、用mysql -uroot -p 登陆mysql,然后采用以下方法开启远程访问权限:
方法1:mysql>use mysql; mysql>update user set host = ‘%’ where user = ‘root’;
mysql>FLUSH RIVILEGES;
方法2:mysql>GRANT ALL PRIVILEG
vim /etc/my.cnf注释这一行:bind-address=127.0.0.1 ==> #bind-address=127.0.0.1保存退出。mysql -uroot -p123456
为需要远程登录的用户赋予权限: 代码如下:mysql> GRANT ALL PRIVILEGES ON *.* TO root”%” IDENTIFIED BY “123456”;mysql> flush privileges;
远程登录命令:mysql -h 223.4.92.130