Skip to main content

[CPANEL-22282] No MySQL for clients on MariaDB 10.2

Comments

21 comments

  • 24x7server
    Hi,
    mysql: Can't read dir of '/etc/my.cnf.d' (Errcode: 2 "No such file or directory")

    I am not sure what you are doing but when you login into the user, you have to give the -u and -p paramter and enter the appropriate username and password to connect to the database.. Also, from the error you reported, it appears that the user has no read access to the mentioned file to login. Check if it does..
    0
  • Clud7
    Hi, I am not sure what you are doing but when you login into the user, you have to give the -u and -p paramter and enter the appropriate username and password to connect to the database.. Also, from the error you reported, it appears that the user has no read access to the mentioned file to login. Check if it does..

    Hello and thank you for your prompt reply! In mysql 5.6 i was able to open the mysql terminal via root and user profile. Now after the upgrade, (MariaDB 10.2) i am able to open the mysql terminal only via root user. The result is: [veto@data ~]$ mysql -u veto --password='PASSWORD' veto_products
    With --no-defaults WORKS FINE!!! mysql --no-defaults -u veto --password='PASSWORD' veto_products
    Thinking that the problem is my.cnf file. Any idea how i should fix it to work correctly? I want to be able to run my mysql cron jobs again via clients cpanel. About the permissions: 52851 52855 And this is my.cnf file: 52859 52863
    0
  • 24x7server
    Hi, Login to the user and perform below steps: cat /etc/my.cnf mysql -u -p --> and then hit enter. Enter the password when prompted.
    0
  • Clud7
    Hi, Login to the user and perform below steps: cat /etc/my.cnf mysql -u -p --> and then hit enter. Enter the password when prompted.

    52875 With --no-defaults the command works 52879 Thanks
    0
  • Clud7
    The problem is the /etc/my.cnf file! After the Upgrade from Mysql to MariaDB you should change the 52883 Steps: " I renamed the my.cnf to my.cnf.old " I restarted the Mysql " New my.cnf file re-created automatically " I edit the file with my personal mysqld configurations. Now it works.
    0
  • cPanelLauren
    Hi @Clud7 I'm happy to hear you found the solution to this issue though I wonder if there was some further customization done to your /etc/my.cnf file as I haven't needed to do this on a mysql -> MariaDB switch or upgrade. Thanks for letting us know what fixed the issue!
    0
  • Clud7
    Hi @Clud7 I'm happy to hear you found the solution to this issue though I wonder if there was some further customization done to your /etc/my.cnf file as I haven't needed to do this on a mysql -> MariaDB switch or upgrade. Thanks for letting us know what fixed the issue!

    Hello! My /etc/my.cnf file was the default one. 52887
    0
  • cPanelLauren
    Hi @Clud7 Thank you for that, what were the permissions and ownership of it? The default provided by cPanel looks like: [root@server php-fpm]# cat /etc/my.cnf [mysqld] innodb_file_per_table=1 default-storage-engine=MyISAM performance-schema=0 max_allowed_packet=268435456 open_files_limit=2048 general-log general-log-file=queries.log log-output=file
    Not much involved nor does it specify the log dir. It does look like yours is also specifically including the dir you were experiencing issues with on line 10 which isn't present in the default my.cnf file. Thanks!
    0
  • Clud7
    Hi @Clud7 Thank you for that, what were the permissions and ownership of it? The default provided by cPanel looks like: [root@server php-fpm]# cat /etc/my.cnf [mysqld] innodb_file_per_table=1 default-storage-engine=MyISAM performance-schema=0 max_allowed_packet=268435456 open_files_limit=2048 general-log general-log-file=queries.log log-output=file
    Not much involved nor does it specify the log dir. It does look like yours is also specifically including the dir you were experiencing issues with on line 10 which isn't present in the default my.cnf file. Thanks!

    Unfortunately i have the new /etc/my.cnf but i can confirm that the permissions and ownership for the old file my.cnf was the same as the new. We had to update the mysql 5.6 to MariaDB 10.2 because of the GDPR so the file was untouched from May 2017 till now 52903 Also some info about our Server: 52907
    0
  • cPanelLauren
    Hi @Clud7 I believe the issue was due to the specified inclusion of the directory in the old my.cnf From my previous post: [QUOTE]It does look like yours is also specifically including the dir you were experiencing issues with on line 10 which isn't present in the default my.cnf file.
    While that directory exists it's not specifically included in the my.cnf file on default installations. Is it present on the current new my.cnf file? Thanks!
    0
  • Clud7
    Hi @Clud7 I believe the issue was due to the specified inclusion of the directory in the old my.cnf From my previous post: While that directory exists it's not specifically included in the my.cnf file on default installations. Is it present on the current new my.cnf file? Thanks!

    The new auto-created my.cnf file was exactly like the image below: 52963 After i added everything from my old my.cnf like below (except the !includedir /etc/my.cnf.d) 52967 After that: All the cronjobs started and my users have full access to mysql command like: mysql -u USERNAME --password='PASSWORD' 100% Success.
    0
  • cPanelLauren
    Hi @Clud7 That's great, thank you for posting exactly what worked for you!
    0
  • cPanelLauren
    HI @Clud7 I wanted to mention here as it was brought to my attention today that MariaDB is adding this directive automatically: $ grep include /etc/my.cnf # include all files from the config directory !includedir /etc/my.cnf.d
    The issue being that libvirtfs.c does not include /etc/my.cnf.d as a virtual mount which in turn causes accounts with jailshell to experience the above issue. To rectify this we've got an internal case open CPANEL-22282 I'll update here when the case has been implemented or if any new important information becomes available. Thanks!
    0
  • sparek-3
    As a temporary work around, could you add /etc/my.cnf.d into the file /var/cpanel/jailshell-additional-mounts Would that work?
    0
  • cPanelLauren
    Hi @sparek-3 It would work I did tested it on my test server though and confirmed I no longer get the error: # cat /var/cpanel/jailshell-additional-mounts /etc/my.cnf.d
    Then accessing the user and mysql: [root@server ~]# su lauren [lauren@server ~]$ mysql -ulauren -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 78 Server version: 10.2.17-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> exit Bye
    For those unaware we have documentation on this here:
    0
  • sparek-3
    I thought you could just put the directory name in that file and it would apply to all users? Perhaps you have to unmount all of the virtfs mounts in order to get jailshell to remount everything? cat /proc/mounts | awk '{print $2}' | grep /home/virtfs | xargs -n1 umount (you may have to run this several times to force all virtfs to unmount) Then when you initiate a new jailshell does it mount everything, including the directories listed in /var/cpanel/jailshell-additional-mounts? I've never appended the username to additional mount points in /var/cpanel/jailshell-additional-mounts
    0
  • cPanelLauren
    Hi @sparek-3 You're correct, I just tested without the username and it does continue to work - I've edited my post accordingly. Thanks for the correction. For my testing I didn't have to manually mount/umount anything that was added to /var/cpanel/jailshell-additional-mounts was automatically mounted to /home/virtfs/
    0
  • Clud7
    HI @Clud7 I wanted to mention here as it was brought to my attention today that MariaDB is adding this directive automatically: $ grep include /etc/my.cnf # include all files from the config directory !includedir /etc/my.cnf.d
    The issue being that libvirtfs.c does not include /etc/my.cnf.d as a virtual mount which in turn causes accounts with jailshell to experience the above issue. To rectify this we've got an internal case open CPANEL-22282 I'll update here when the case has been implemented or if any new important information becomes available. Thanks!

    Great news! So the MySQL upgrade works fine and you only have to update the /var/cpanel/jailshell-additional-mounts. Thanks a lot!
    0
  • cPanelLauren
    To add to that @Clud7 while yes this is a viable workaround for now, we're also going to keep it from occurring in the first place so you don't have to implement a workaround.
    0
  • cPanelMichael
    Hello, To update, CPANEL-22282 is fixed in cPanel & WHM version 76: Fixed case CPANEL-22282: Ensure MariaDB CLI functions in jailshell. The full change log is available at:
    0
  • Dogs DB
    Hello and thank you for your prompt reply! In mysql 5.6 i was able to open the mysql terminal via root and user profile. Now after the upgrade, (MariaDB 10.2) i am able to open the mysql terminal only via root user. The result is: [veto@data ~]$ mysql -u veto --password='PASSWORD' veto_products
    With --no-defaults WORKS FINE!!! mysql --no-defaults -u veto --password='PASSWORD' veto_products
    Thinking that the problem is my.cnf file. Any idea how i should fix it to work correctly? I want to be able to run my mysql cron jobs again via clients cpanel. About the permissions: 52851 52855 And this is my.cnf file: 52859 52863

    Helpful
    0

Please sign in to leave a comment.