invoking mysql from command line throws "mysql: unknown variable 'pid-file=/run/mysqld/mysqld.pid'"

Discussion in 'Linux Beginners' started by intellivision, Feb 11, 2021.

Tags:
  1. intellivision

    intellivision New Member

    Code:
    $ mysql --user=root --password=mypw mydb
    result

    Code:
    mysql: unknown variable 'pid-file=/run/mysqld/mysqld.pid'
    Debian 10 (buster), MariaDB. The server is running, MariaDB is running fine. Nothing appears to be broken.

    I don't know when this started happening. It worked when I built the VM a few months ago.

    When I tail journalctl and run the mysql command, nothing displays in journal.

    $ sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf shows:
    Code:
    [mysql]
    user                            = mysql
    pid-file                        = /run/mysqld/mysqld.pid
    socket                          = /run/mysqld/mysqld.sock
    
    [mysqld]
    basedir                         = /usr
    datadir                         = /var/lib/mysql
    tmpdir                          = /tmp
    lc-messages-dir                 = /usr/share/mysql
    bind-address                    = 127.0.0.1
    
    log_error                       = /var/log/mysql/error.log
    slow_query_log_file             = /var/log/mysql/mariadb-slow.log
    long_query_time                 = 1
    slow_query_log                  = 0
    expire_logs_days                = 10
    
    character-set-server            = utf8mb4
    collation-server                = utf8mb4_general_ci
    ft_min_word_len                 = 3
    
    wait_timeout                    = 15
    interactive_timeout             = 1200
    
    max_connections                 = 500
    
    tmp_table_size                  = 1G
    max_heap_table_size             = 1G
    
    
    # InnoDB Settings ------------------------------
    default_storage_engine          = InnoDB
    innodb_buffer_pool_instances    = 11     # Use 1 instance per 1GB of InnoDB pool size
    innodb_buffer_pool_size         = 11G    # Use up to 70-80% of RAM #MATT doubled
    innodb_file_per_table           = 1
    innodb_flush_log_at_trx_commit  = 0
    innodb_flush_method             = O_DIRECT
    innodb_log_buffer_size          = 16M
    innodb_log_file_size            = 512M
    innodb_stats_on_metadata        = 0
    
    innodb_read_io_threads          = 64
    innodb_write_io_threads         = 64
    
    max_allowed_packet              = 32M
    thread_stack                    = 192K
    thread_cache_size               = 32
    
    
    # MyISAM Settings ------------------------------
    # don't need with memcached MATT
    query_cache_type                = 0
    query_cache_size                = 0
    
    query_cache_limit               = 4M    # UPD - Option supported by MariaDB & up to MySQL 5.7, remove this line on MySQL 8.x
    #query_cache_size                = 64M   # UPD - Option supported by MariaDB & up to MySQL 5.7, remove this line on MySQL 8.x
    #query_cache_type                = 1
    table_definition_cache          = -1
    read_buffer_size                = 128K
    
    key_buffer_size                 = 64M
    key_buffer                      = 64M
    join_buffer_size                = 128M
    sort_buffer_size                = 256M
    
    table_open_cache                = 400000
    open_files_limit                = 1000000
    
    myisam-recover                  = BACKUP
    thread_concurrency              = 10
    
    performance_schema              = OFF
    $ sudo systemctl status mariadb shows:
    Code:
    Jan 26 21:36:59 vm-6 mysqld[397]: 2021-01-26 21:36:59 0 [Warning] Could not increase number of max_open_files to more than 700000 (request: 6400535)
    Jan 26 21:36:59 vm-6 mysqld[397]: 2021-01-26 21:36:59 0 [Warning] Changed limits: max_open_files: 700000  max_connections: 500 (was 500)  table_cache: 349735 (was 400000)
    Jan 26 21:36:59 vm-6 systemd[1]: Started MariaDB 10.3.27 database server.
    Jan 26 21:37:00 vm-6 /etc/mysql/debian-start[575]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
    Jan 26 21:37:00 vm-6 /etc/mysql/debian-start[575]: Looking for 'mysql' as: /usr/bin/mysql
    Jan 26 21:37:00 vm-6 /etc/mysql/debian-start[575]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
    Jan 26 21:37:00 vm-6 /etc/mysql/debian-start[575]: Version check failed. Got the following error when calling the 'mysql' command line client
    Jan 26 21:37:00 vm-6 /etc/mysql/debian-start[575]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
    Jan 26 21:37:00 vm-6 /etc/mysql/debian-start[575]: FATAL ERROR: Upgrade failed
    Jan 26 21:37:00 vm-6 /etc/mysql/debian-start[586]: Checking for insecure root accounts.
    Thanks for reading.
     
  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Try moving the pid-file line into the mysqld section.
     
    intellivision likes this.
  3. intellivision

    intellivision New Member

    Jesse, that was it! Thank you!
     

Share This Page