Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

cPanel adds backslash in mysql db table?

Discussion in 'General Discussion' started by dindesign, Oct 26, 2004.

  1. dindesign

    dindesign Registered

    Joined:
    Oct 25, 2004
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    151
    Anyone knows why cPanel is adding a backslash before the underscore in the mysql "db" table? If I have a subhost called "test", and from cPanel I create a db called "mtest", a user called "muser" for a table called "mtable" in cPanel and check out the mysql db table with root afterwards, the fields Db and user in the db table shows in one row:

    Code:
    Db: "test\_mtest"
    user: "test_muser"
    What is the point of that backslash? The thought crossed my mind that it was a bug, but I checked out /usr/local/cpanel/Cpanel/Mysql.pm and found this on line 276:

    Code:
    if ($db !~ /\\_/) {  $db =~ s/_/\\_/g; }
    A search/replace regexp for _ to \_... So this is deliberate, but I wonder why? It makes the auto-creation scripts I'm making a whole lot more awkward. (bye bye GRANT for example...) :confused:


    /Andreas
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice