The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

varchar(10)

Discussion in 'Database Discussions' started by canou83, Mar 14, 2017.

  1. canou83

    canou83 Well-Known Member

    Joined:
    Jul 20, 2016
    Messages:
    62
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    France
    cPanel Access Level:
    Website Owner
    Hi, for a synchronization application between 2 sites / databases we need to insert more than 10 characters. Out of the classical operation of the base inserts the first 10 characters.

    MySQL :: MySQL 5.7 Reference Manual :: 6.1.8 Server SQL Modes indique qu'il faut modifier le fichier de config de mysql, But every time you restart mysql it gets back up. We need this value to change.

    We do not know where the server takes this value or how to change it permanently.


    Thank you for your help.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You can add a line like this to your /etc/my.cnf file and then restart the MySQL service:

    Code:
    sql_mode="TRADITIONAL"
    Thank you.
     
  3. canou83

    canou83 Well-Known Member

    Joined:
    Jul 20, 2016
    Messages:
    62
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    France
    cPanel Access Level:
    Website Owner
    Hi and thank you for your reply. If I add that, it will remove the limit of 10 carcatères? And especially make it final even after a server restart?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  5. canou83

    canou83 Well-Known Member

    Joined:
    Jul 20, 2016
    Messages:
    62
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    France
    cPanel Access Level:
    Website Owner
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Thank you for explaining the issue further. You may also want to verify that /usr/my.cnf does not exist on the system, as it will overwrite your /etc/my.cnf file settings. If it does exist, try disabling this file and restarting MySQL:

    Code:
    mv /usr/my.cnf /usr/my.cnf.backup1
    /scripts/restartsrv_mysql
    Thank you.
     
  7. canou83

    canou83 Well-Known Member

    Joined:
    Jul 20, 2016
    Messages:
    62
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    France
    cPanel Access Level:
    Website Owner
    Hello. We're trying. It looks to be good. Thanks for your advices. We will return to you if need be.
     
    cPanelMichael likes this.

Share This Page