Welcome to Centmin Mod Community
Register Now

MariaDB Running query

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by dooma, Jul 18, 2017.

  1. dooma

    dooma Member

    226
    22
    18
    Oct 15, 2016
    Cairo
    Ratings:
    +27
    Local Time:
    9:45 AM
    Please fill in any relevant information that applies to you:
    • CentOS Version: i.e. CentOS 7 64bit
    • Centmin Mod Version Installed: i.e. 123.09beta01
    • Nginx Version Installed: i.e. latest
    • PHP Version Installed: i.e. 5.6.30
    • MariaDB MySQL Version Installed: i.e. 10.1.21

    Hello

    How can I run the below query to the database because I have an issue with my XenProducts xenforo addon :

    Code:
    ALTER TABLE `xenproduct_version`
    ADD COLUMN `is_unsupported` TINYINT(1) NOT NULL DEFAULT '0' AFTER `version_details`
    Thanks
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,841
    6,903
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,393
    Local Time:
    5:45 PM
    Nginx 1.13.x
    MariaDB 5.5
    always backup your database first but just wrap query in mysql -e "YOUR QUERY;" YOURDBNAME for command line or run mysql interactive command to just type those queries in ending with semi colon ; or via text file

    single line command but if you do this in SSH pay attention to backticks as they have a different meaning in SSH = run command so need to be removed
    Code (Text):
    mysql -e "ALTER TABLE xenproduct_version ADD COLUMN is_unsupported TINYINT(1) NOT NULL DEFAULT '0' AFTER version_details;" YOURDBNAME
    

    successful run will return empty to prompt
    see
     
  3. dooma

    dooma Member

    226
    22
    18
    Oct 15, 2016
    Cairo
    Ratings:
    +27
    Local Time:
    9:45 AM
    Thanks SOLVed :)
     
    • Like Like x 1