美文网首页我爱编程
mysql配置的相关问题 以及oracle转mysql遇到的坑

mysql配置的相关问题 以及oracle转mysql遇到的坑

作者: spurs_ | 来源:发表于2018-04-13 10:45 被阅读0次

    解压版本回没有my.ini文件

    自己创建 可以复制my-default.ini文件,


    # For advice on how to change settings please see

    # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html

    # *** DO NOT EDIT THIS FILE. It's a template which will be copied to the

    # *** default location during install, and will be replaced if you

    # *** upgrade to a newer version of MySQL.

    [mysqld]

    # Remove leading # and set to the amount of RAM for the most important data

    # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.

    # innodb_buffer_pool_size = 128M

    # Remove leading # to turn on a very important data integrity option: logging

    # changes to the binary log between backups.

    # log_bin

    # These are commonly set, remove the # and set as required.

    # basedir = .....

    # datadir = .....

    # port = .....

    # server_id = .....

    #mysql所在目录

    basedir = C:/Program Files/Java/mysql-5.6.35-winx64

    #mysql数据文件目录

    datadir = C:/Program Files/Java/mysql-5.6.35-winx64/data

    #设置默认的字符编码

    #character_set_client=utf8

    #character_set_connection=utf8

    #character_set_database=utf8

    #character_set_result=utf8

    #character_set_system=utf8

    character_set_server=utf8

    init_connect='SET NAMES utf8'

    collation-server=utf8_general_ci

    # Remove leading # to set options mainly useful for reporting servers.

    # The server defaults are faster for transactions and fast SELECTs.

    # Adjust sizes as needed, experiment to find the optimal values.

    # join_buffer_size = 128M

    # sort_buffer_size = 2M

    # read_rnd_buffer_size = 2M

    sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

    [client]

    default-character-set=utf8



    没有创建my.ini,时候服务器仍然可以启动,但是默认配置会是gbk (此时最容易出问题,我在没配置之前创建了一个数据库用Oracle向mysql数据库里面传数据 ,会各种报错,原因就在于此,要先将之前的删掉或者改变其默认配置,字符集等编码格式 utf8 和 utf8_general_ci),配置之后cmd 进入黑窗口,net stop mysql  ,net start mysql  重启才会生效


    show variables like 'char%';查看数据库编码格式

    这样说明配置生效

    使用navicat premium 可以进行oracle转mysql ,

    使用前记得配置连接oracle的客户端instantclient 

    instantclient用64位的,之前用32位时候也会出现连接不上oracle的情况,同时记得客户端要与navicat premium版本匹配 还要记得配置这个,就是instantclient的路径

    相关文章

      网友评论

        本文标题:mysql配置的相关问题 以及oracle转mysql遇到的坑

        本文链接:https://www.haomeiwen.com/subject/oaypmxtx.html