玉貔貅

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

1.Mysql 使用 Navicat连接时报错:

    报错内容:Client does not support authentication protocol requested  by server;

    解决方法:       

        1.use mysql;

        2.alter user 'root'@'localhost' identified with mysql_native_password by '密码‘;

        3.flush privileges;

 

 

2.Mysql 插入数据失败:默认编码格式输入中文 插入失败。

    解决方法:

      ALTER TABLE `table` DEFAULT CHARACTER SET utf8;     修改表的编码格式,但是字段的编码格式并没有修改

      ALTER TABLE `tablename` CHANGE `字段名1` `字段名2` VARCHAR(36) CHARACTER SET utf8 NOT NULL;  作用是修改字段的编码格式

      alter table `tablename` convert to character set utf8;   修改一张表的所有编码字段 

 

posted on 2019-01-25 16:15  玉貔貅  阅读(140)  评论(0编辑  收藏  举报