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!

User Access to Database

Discussion in 'Database Discussion' started by Steve Kessler, Jun 27, 2015.

  1. Steve Kessler

    Steve Kessler Active Member

    Joined:
    Feb 22, 2015
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Denver, Colorado, United State
    cPanel Access Level:
    Root Administrator
    I am trying ensure the user I am running a bash script with has full access to my database via a my.conf file that specifies a valid username and password. I tried to locate the my.conf on my system and I do not see a way to do that. I think I know what I need to add to my.conf file but I am not sure where it is with cPanel.

    Thanks!
     
  2. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,664
    Likes Received:
    69
    Trophy Points:
    203
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    located in your /home/usename and its .my.cnf (its hidden)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. feldon27

    feldon27 Well-Known Member

    Joined:
    Mar 12, 2003
    Messages:
    118
    Likes Received:
    13
    Trophy Points:
    168
    Location:
    Houston, TX
    I'm curious why you need a my.cnf file to do a bash script. Have you tried something like:

    #!/bin/sh
    fdb=feldon30_testforum
    fuser=feldon30
    fpw=U$fkds0431
    fdate=`eval date +%Y-%m-%d`

    mysql -u $fuser -p$fpw -D $fdb -e "UPDATE tracking SET lastupdate=$fdate;"​
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,794
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello :)

    Have you considered authenticating with a MySQL username/password directly in the script as referenced in the previous post?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
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